[英]Windows Phone Dev 8 change HyperlinkButton Image (NO SILVERLIGHT)
I'm making an Application where I change my HyperlinkButton image but it doesn't go. 我正在制作一个应用程序,在其中更改我的HyperlinkButton图像,但它没有成功。
var brush = new ImageBrush();
brush.ImageSource = new BitmapImage(new Uri("/Pics/Test/1/1_10.png", UriKind.Relative));
MainButton.Background = brush;
I put this code in the click event method but the Debugger goes after the second Line to this code: 我将此代码放在click事件方法中,但调试器在此代码的第二行之后:
#if DEBUG && !DISABLE_XAML_GENERATED_BREAK_ON_UNHANDLED_EXCEPTION
UnhandledException += (sender, e) =>
{
if (global::System.Diagnostics.Debugger.IsAttached) global::System.Diagnostics.Debugger.Break();
};
#endif
I think you might be getting an exception because of an invalid URI. 我认为您可能是因为无效的URI而导致异常。 Take a look at URI schemes here: https://msdn.microsoft.com/en-us/library/windows/apps/jj655406.aspx
在这里查看URI方案: https : //msdn.microsoft.com/zh-cn/library/windows/apps/jj655406.aspx
Also, the image should be added as Content. 另外,图像应作为内容添加。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.