Пример #1
0
 private void Button_Click(object sender, RoutedEventArgs e)
 {
     if (sender == btnOk)
     {
         _result = MessageBoxResult.OK;
     }
     else if (sender == btnYes)
     {
         _result = MessageBoxResult.Yes;
     }
     else if (sender == btnNo)
     {
         _result = MessageBoxResult.No;
     }
     else if (sender == btnCancel)
     {
         _result = MessageBoxResult.Cancel;
     }
     else
     {
         _result = MessageBoxResult.None;
     }
     _messageBox.Close();
     _messageBox = null;
 }
Пример #2
0
 public static MessageBoxResult Show
     (string caption, string text,
     MessageBoxButton button, MessageBoxImage image, string msgUri)
 {
     _messageBox = new SelectableMessageBox
     {
         txtMsg = { Text = text }, MessageTitle = { Text = caption }
     };
     SetVisibilityOfButtons(button);
     // SetImageOfMessageBox(image);
     if (msgUri != "")
     {
         _messageBox.SetImagePhoto(msgUri);
     }
     _messageBox.ShowDialog();
     return(_result);
 }