Ejemplo n.º 1
0
 public static MessageBoxResult Show(
     Action <Window> setOwner,
     string messageBoxText,
     string caption,
     MessageBoxButton button,
     MessageBoxImage icon,
     MessageBoxResult defaultResult,
     MessageBoxOptions options)
 {
     if ((options & MessageBoxOptions.DefaultDesktopOnly) == MessageBoxOptions.DefaultDesktopOnly)
     {
         throw new NotImplementedException();
     }
     if ((options & MessageBoxOptions.ServiceNotification) == MessageBoxOptions.ServiceNotification)
     {
         throw new NotImplementedException();
     }
     WPFMessageBoxWindow._messageBoxWindow = new WPFMessageBoxWindow();
     setOwner((Window)WPFMessageBoxWindow._messageBoxWindow);
     WPFMessageBoxWindow.PlayMessageBeep(icon);
     WPFMessageBoxWindow._messageBoxWindow._viewModel  = new MessageBoxViewModel(WPFMessageBoxWindow._messageBoxWindow, caption, messageBoxText, button, icon, defaultResult, options);
     WPFMessageBoxWindow._messageBoxWindow.DataContext = (object)WPFMessageBoxWindow._messageBoxWindow._viewModel;
     WPFMessageBoxWindow._messageBoxWindow.ShowDialog();
     return(WPFMessageBoxWindow._messageBoxWindow._viewModel.Result);
 }
Ejemplo n.º 2
0
 private static MessageBoxResult ShowCore(
     Window owner,
     string messageBoxText,
     string caption                 = "",
     MessageBoxButton button        = MessageBoxButton.OK,
     MessageBoxImage icon           = MessageBoxImage.None,
     MessageBoxResult defaultResult = MessageBoxResult.None,
     MessageBoxOptions options      = MessageBoxOptions.None)
 {
     return(WPFMessageBoxWindow.Show((Action <Window>)(messageBoxWindow => messageBoxWindow.Owner = owner), messageBoxText, caption, button, icon, defaultResult, options));
 }
Ejemplo n.º 3
0
 public MessageBoxViewModel(
     WPFMessageBoxWindow view,
     string title,
     string message,
     MessageBoxButton buttonOption,
     MessageBoxImage image,
     MessageBoxResult defaultResult,
     MessageBoxOptions options)
 {
     this.Title        = title;
     this.Message      = message;
     this.ButtonOption = buttonOption;
     this.Options      = options;
     this.SetDirections(options);
     this.SetButtonVisibility(buttonOption);
     this.SetImageSource(image);
     this.SetButtonDefault(defaultResult);
     this._view = view;
 }