예제 #1
0
        private void ShowMessageInner(string title, string message, NotificationMessageFlags flags)
        {
            if (_notificationMessage != null) _notificationMessage.Close();

            _notificationMessage = new NotificationMessage(title, message, flags);
            _notificationMessage.ShowDialog();
        }
 public NotificationMessage(string title, string message, NotificationMessageFlags flags)
 {
     if (Application.Current.MainWindow.IsVisible) Owner = Application.Current.MainWindow;
     DataContext = this;
     InitializeComponent();
     Message.Text = message;
     Title = title;
     if (flags.HasFlag(NotificationMessageFlags.NonClosable))
     {
         CloseButtonVisibility = Visibility.Collapsed;
     } 
     else
     {
         Loaded += OnLoaded;
     }
 }
예제 #3
0
 public NotificationMessage(string title, string message, NotificationMessageFlags flags)
 {
     if (Application.Current.MainWindow.IsVisible)
     {
         Owner = Application.Current.MainWindow;
     }
     DataContext = this;
     InitializeComponent();
     Message.Text = message;
     Title        = title;
     if (flags.HasFlag(NotificationMessageFlags.NonClosable))
     {
         CloseButtonVisibility = Visibility.Collapsed;
     }
     else
     {
         Loaded += OnLoaded;
     }
 }
예제 #4
0
 public void ShowMessage(string title, string message, NotificationMessageFlags flags = NotificationMessageFlags.None)
 {
     UIThread.Run(() => ShowMessageInner(title, message, flags));
 }
예제 #5
0
 public void ShowMessage(string title, string message, NotificationMessageFlags flags = NotificationMessageFlags.None)
 {
     Console.WriteLine("[{0}Message] Title: {1}, Text: {2}", flags == NotificationMessageFlags.NonClosable ? "Open " : string.Empty, title, message);
 }