我尝试在MessageBoxResult自定义图像枚举的MessageBoxResult
创建构建自定义MessageBoxImage对于自MessageBoxImage枚举,我有:
public enum CustomBoxImage
{
Foo = new BitmapImage(new Uri(@"pack://application:,,,/MySoftware;component/Images/foo.png"))
}
和MessageBoxResult,我有:
MessageBoxResult mrb = MessageBox.Show(
"This will kill you. Are you sure?",
"Kill you",
MessageBoxButton.YesNo, CustomBoxImage.Foo);
但它给我这个错误:
无法将“... CustomBoxImage”转换为“System.Windows.MessageBoxImage”
如何将自定义图像枚举插入到MessageBoxResult中?或者,甚至有可能吗?
可能的重复http://stackoverflow.com/questions/3169996/c-wpf-custom-message-box –
不好意思,你觉得它曾经应该是你的解决方案吗? MessageBox.Show需要枚举System.Windows.MessageBoxImage的值,并且不能通过任何你想要的东西! –
@Davide:确实这是有点明显 – RvdK