我正在尝试这样做...
<Image x:Name="imgGroupImage" Source="Images\unlock.png" Margin="0,0,5,0" />
但我得到这个错误......
无法将属性“Source”中的字符串“Images\unlock.png”转换为“System.Windows.Media.ImageSource”类型的对象。找不到资源“forms/images/unlock.png”。标记文件“Fuse;component/forms/mainwindow.xaml”第 273 行位置 51 中的对象“System.Windows.HierarchicalDataTemplate”出错。
如您所见,包含此 XAML 的表单位于名为 Forms 的文件夹中。我的图像位于名为 Images 的文件夹中。如何从表单映射到图像?
我试过Source="..Images\unlock.png"
在 WPF 中不起作用。
有什么帮助吗?