Ejemplo n.º 1
0
 public static void ShowNonModal(string messageBoxText, string caption)
 {
     MessageBoxView messageBoxView = new MessageBoxView();
       messageBoxView.Caption = caption;
       try
       {
     if (Application.Current.MainWindow != null && Application.Current.MainWindow.IsVisible)
       messageBoxView.Owner = Application.Current.MainWindow;
       }
       catch
       {
       }
       if (!string.IsNullOrEmpty(messageBoxText))
     messageBoxView.Message = new MetroTwitStatusBase()
     {
       RawText = messageBoxText,
       Entities = RegularExpressions.ExtractEntities(messageBoxText)
     };
       messageBoxView.LayoutRoot.Triggers.Clear();
       messageBoxView.Show();
 }
Ejemplo n.º 2
0
 public static MessageBoxResult Show(Window owner, string messageBoxText, string caption, MessageBoxButton button, MessageBoxResult defaultResult)
 {
     MessageBoxView messageBoxView = new MessageBoxView();
       messageBoxView.Caption = caption;
       try
       {
     messageBoxView.DefaultResult = defaultResult;
     if (owner != null && owner.IsVisible)
       messageBoxView.Owner = owner;
       }
       catch
       {
       }
       if (!string.IsNullOrEmpty(messageBoxText))
     messageBoxView.Message = new MetroTwitStatusBase()
     {
       RawText = messageBoxText,
       Entities = RegularExpressions.ExtractEntities(messageBoxText)
     };
       messageBoxView.MessageBoxButton = button;
       messageBoxView.MessageBoxImage = MessageBoxImage.None;
       bool? nullable = messageBoxView.ShowDialog();
       if ((nullable.GetValueOrDefault() ? 0 : (nullable.HasValue ? 1 : 0)) != 0)
     return MessageBoxResult.Cancel;
       else
     return messageBoxView.MessageBoxResult;
 }