我正在尝试为我的XAML元素更改图像,但无法弄清楚如何,我正在使用http://www.divelements.co.uk/net/controls/sandribbonsl/的沙带按钮。我知道如何做到这一点?
XAML代码:
<sr:Button x:Name="Print" Text="Print" SmallImage="/Fsc.Feenics.Clients.Silverlight2;component/Images/16/print.png" Size="Small" Activate="Button_Activate" />
(破碎)C#代码:
Print.SmallImage = new BitmapImage(new Uri("/Fsc.Feenics.Clients.Silverlight2;component/Images/16/printOn.png"));
谢谢,
杰森
答案 0 :(得分:1)
将UriKind.RelativeOrAbsolute
添加到以下行:
Print.SmallImage = new BitmapImage(
new Uri("/Fsc.Feenics.Clients.Silverlight2;component/Images/16/printOn.png",
UriKind.RelativeOrAbsolute));