這是我的代碼它顯示你做錯了在BitmapImage的我想背景圖片添加到我的自定義消息框,但我無法得到它
CustomMessageBox messageBox = new CustomMessageBox()
{
Caption = "Congratulations",
Message = "you have won",
LeftButtonContent = "Play Again",
RightButtonContent = "FB Share",
VerticalAlignment = VerticalAlignment.Center,
Background = new BitmapImage(new Uri("/imaC:/Users/Rupak/Documents/Visual Studio 2012/Projects/sachin/sachin/image.png")),
Foreground = new SolidColorBrush(Colors.Black),
};
嘗試不同的Uri(「/ image.png」,UriKind.RelativeOrAbsolute) - 如果圖像位於項目的根文件夾中。 – Romasz
它顯示錯誤bitmapimage無法找到 – zap92
我試過imagesource而不是bitmapimage它仍然顯示一些錯誤 – zap92