Example #1
0
        private static void SetImageOfMessageBox(MessageBoxImage image)
        {
            switch (image)
            {
            case MessageBoxImage.Warning:
                _messageBox.SetImage("box_quaggan.png");
                break;

            case MessageBoxImage.Question:
                _messageBox.SetImage("lollipop_quaggan.png");
                break;

            case MessageBoxImage.Information:
                _messageBox.SetImage("cheer_quaggan.png");
                break;

            case MessageBoxImage.Error:
                _messageBox.SetImage("cry_quaggan.png");
                break;

            default:
                _messageBox.img.Visibility = Visibility.Collapsed;
                break;
            }
        }
Example #2
0
 public static MessageBoxResult Show(string caption, string text, MessageBoxButton button, MessageBoxImage image)
 {
     if (_messageBox != null)
     {
         _messageBox.Close();
         _messageBox = null;
     }
     _messageBox = new WpfMessageBox {
         txtMsg = { Text = text }, MessageTitle = { Text = caption }
     };
     SetVisibilityOfButtons(button);
     SetImageOfMessageBox(image);
     _messageBox.ShowDialog();
     return(_result);
 }