37 lines
1.1 KiB
C#
37 lines
1.1 KiB
C#
using MahApps.Metro.Controls;
|
|
using MahApps.Metro.Controls.Dialogs;
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
using System.Threading.Tasks;
|
|
|
|
namespace Community
|
|
{
|
|
/// <summary>
|
|
/// 自定义提示框
|
|
/// </summary>
|
|
public class MyMessageBox
|
|
{
|
|
#region MetroWindow相关参数
|
|
/// <summary>
|
|
/// 窗体对象
|
|
/// </summary>
|
|
public static MetroWindow MetroWin { get; set; }
|
|
static MetroDialogSettings settings = new MetroDialogSettings() { AffirmativeButtonText="确定", NegativeButtonText = "取消"};
|
|
#endregion
|
|
|
|
|
|
/// <summary>
|
|
/// 显示提醒窗
|
|
/// </summary>
|
|
/// <param name="title"></param>
|
|
/// <param name="message"></param>
|
|
/// <param name="style"></param>
|
|
public static MessageDialogResult Show(string message, string title="", MessageDialogStyle style = MessageDialogStyle.Affirmative)
|
|
{
|
|
return MetroWin.ShowModalMessageExternal(title, message, style, settings);
|
|
}
|
|
}
|
|
}
|