Пример #1
0
        public static DialogResult Show(string message, CmessageBoxTitle title)
        {
            myMessageBoxInfo = new MessagBoxInfo();
            myMessageBoxInfo.txtMessagebx.Text = message;
            //myMessageBoxInfo.btnOk = myMessageBoxInfo.GetMessageButton(btnOk);
            myMessageBoxInfo.txtTitel.Text = myMessageBoxInfo.GetTitle(title);
            //icon
            switch (title)
            {
            case CmessageBoxTitle.Info:
                myMessageBoxInfo.iconMsg.Kind       = MaterialDesignThemes.Wpf.PackIconKind.InfoCircle;
                myMessageBoxInfo.iconMsg.Foreground = Brushes.Blue;
                break;

            case CmessageBoxTitle.Warning:
                myMessageBoxInfo.iconMsg.Kind       = MaterialDesignThemes.Wpf.PackIconKind.Warning;
                myMessageBoxInfo.iconMsg.Foreground = Brushes.Yellow;
                break;

            case CmessageBoxTitle.Error:
                myMessageBoxInfo.iconMsg.Kind       = MaterialDesignThemes.Wpf.PackIconKind.Error;
                myMessageBoxInfo.iconMsg.Foreground = Brushes.DarkRed;
                break;

            default:
                break;
            }
            myMessageBoxInfo.ShowDialog();
            return(result);
        }
Пример #2
0
 public string GetTitle(CmessageBoxTitle value)
 {
     return(Enum.GetName(typeof(CmessageBoxTitle), value));
 }