/// <summary> /// 错误提示,包含“确定”按钮 /// </summary> /// <param name="owner">拥有弹出窗体的窗体</param> /// <param name="message">提示信息</param> public static bool ShowError(string message, ContentControl owner = null) { MessageBoxInfoForm frm = new MessageBoxInfoForm(owner, Msg_Error, message); string imgPath = "pack://application:,,,/WpfThemes;component/Images/Warning.png"; frm.Img.Source = ConvertToBitmapImage(imgPath); return(frm.ShowDialog().Value); }
/// <summary> /// 程序退出提示 /// </summary> /// <param name="owner">拥有弹出窗体的窗体</param> /// <param name="message">提示信息</param> public static bool ShowShutDown(string message, Window owner = null) { MessageBoxInfoForm frm = new MessageBoxInfoForm(owner, Msg_Confirm, message, true, MessageBoxInfoForm.LoadedType.LoadedStretch); string imgPath = "pack://application:,,,/WpfThemes;component/Images/Shutdown.png"; frm.Img.Source = ConvertToBitmapImage(imgPath); frm.OkButton.Content = "是"; frm.CancelButton.Content = "否"; return(frm.ShowDialog().Value); }
/// <summary> /// 确认提示,包含“是”,“否”按钮 /// </summary> /// <param name="owner">拥有弹出窗体的窗体</param> /// <param name="message">提示信息</param> public static bool ShowConfirmYesNo(string message, ContentControl owner = null) { MessageBoxInfoForm frm = new MessageBoxInfoForm(owner, Msg_Confirm, message, true); string imgPath = "pack://application:,,,/WpfThemes;component/Images/Warning.png"; frm.Img.Source = ConvertToBitmapImage(imgPath); frm.OkButton.Content = "是"; frm.CancelButton.Content = "否"; return(frm.ShowDialog().Value); }