将图像嵌入到VSIX
-
14-11-2019 - |
题
我在vs中与自定义开始页面模板一起玩。
如何嵌入嵌入我可以使用在开始页面XAML中的图像。我已经尝试了将图像设置为资源的正常方式,并将图像控件设置到文件名的源属性。
<Image Source="logo.jpg" />
.
但它不起作用...它建立正常并旋转起始页面确定,但没有显示图像。如果我牢记工作源的源头的URL。
thx 史蒂夫
解决方案
I believe that if you have to set the Source like this:
<Image Source="pack://application:,,,/logo.jpg" />
其他提示
If the Build Action is Resource in the Properties window:
<Image Source="pack://application:,,,/AssemblyName;component/Resources/logo.jpg" />
If the Build Action is Content and Include in VSIX is True in the Properties window:
<Image Source="pack://application:,/Resources/logo.jpg" />
Considering the logo.jpg is in the Resources folder.
You need to set the Source like this
<Image Source="pack://application:,/Resources/view.png" Margin="5"/>
Then you had to mark the picture in the Properties Section as Content and set the Include in VSIX to True.
Hope that would help, Greetings from Noxum
不隶属于 StackOverflow