public static bool?Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType) { MessageBoxWindow window = new MessageBoxWindow(); window.Message = message; window.Detail = detail; window.WindowType = windowType; window.ButtonsType = buttonType; switch (windowType) { case MessageBoxWindowType.Information: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information"); break; case MessageBoxWindowType.Question: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Question"); break; case MessageBoxWindowType.Warning: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Warning"); break; case MessageBoxWindowType.Error: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Error"); break; default: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information"); break; } return(window.ShowDialog()); }
public static bool? Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType) { MessageBoxWindow window = new MessageBoxWindow(); window.Message = message; window.Detail = detail; window.WindowType = windowType; window.ButtonsType = buttonType; switch (windowType) { case MessageBoxWindowType.Information: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information"); break; case MessageBoxWindowType.Question: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Question"); break; case MessageBoxWindowType.Warning: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Warning"); break; case MessageBoxWindowType.Error: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Error"); break; default: window.Title = LanguageString.Find("Presentation_Windows_MessageBoxWindow_Information"); break; } return window.ShowDialog(); }
public static bool? Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType, string title) { MessageBoxWindow window = new MessageBoxWindow(); window.Title = title; window.Message = message; window.Detail = detail; window.WindowType = windowType; window.ButtonsType = buttonType; return window.ShowDialog(); }
public static bool?Show(string message, string detail, MessageBoxWindowType windowType, MessageBoxWindowButtonsType buttonType, string title) { MessageBoxWindow window = new MessageBoxWindow(); window.Title = title; window.Message = message; window.Detail = detail; window.WindowType = windowType; window.ButtonsType = buttonType; return(window.ShowDialog()); }
/// <summary> /// Converts a value. /// </summary> /// <param name="value">The value produced by the binding source.</param> /// <param name="targetType">The type of the binding target property.</param> /// <param name="parameter">The converter parameter to use.</param> /// <param name="culture">The culture to use in the converter.</param> /// <returns> /// A converted value. If the method returns null, the valid null value is used. /// </returns> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value == null) { throw new ArgumentNullException("value"); } MessageBoxWindowType windowType = (MessageBoxWindowType)Enum.Parse(typeof(MessageBoxWindowType), value.ToString(), true); BitmapImage image = new BitmapImage(); image.BeginInit(); switch (windowType) { case MessageBoxWindowType.Question: image.UriSource = new Uri(@"pack://*****:*****@"pack://application:,,,/Gimela.Presentation.Windows;component/Resources/Images/MessageBoxIcons/warning.png", UriKind.Absolute); break; case MessageBoxWindowType.Error: image.UriSource = new Uri(@"pack://*****:*****@"pack://application:,,,/Gimela.Presentation.Windows;component/Resources/Images/MessageBoxIcons/information.png", UriKind.Absolute); break; } image.EndInit(); return(image); }
public static bool? Show(string message, string detail, MessageBoxWindowType windowType, string title) { return Show(message, detail, windowType, MessageBoxWindowButtonsType.Ok, title); }
private static void MessageBoxTypeTranslator(ViewModelMessageBoxType messageBoxType, out MessageBoxWindowType windowType, out MessageBoxWindowButtonsType buttonType) { windowType = MessageBoxWindowType.Information; buttonType = MessageBoxWindowButtonsType.Ok; switch (messageBoxType) { case ViewModelMessageBoxType.Question: windowType = MessageBoxWindowType.Question; buttonType = MessageBoxWindowButtonsType.YesNo; break; case ViewModelMessageBoxType.Warning: windowType = MessageBoxWindowType.Warning; break; case ViewModelMessageBoxType.Error: windowType = MessageBoxWindowType.Error; break; case ViewModelMessageBoxType.None: case ViewModelMessageBoxType.Information: default: break; } }
public static bool?Show(string message, string detail, MessageBoxWindowType windowType, string title) { return(Show(message, detail, windowType, MessageBoxWindowButtonsType.Ok, title)); }