Files
ShrlAlgoToolkit/WPFluent/Controls/MessageBox/MessageBox.Image.cs

30 lines
2.0 KiB
C#
Raw Normal View History

using System.Threading.Tasks;
using System.Windows;
namespace WPFluent.Controls;
public static partial class MessageBox
{
public static System.Windows.MessageBoxResult Information(string messageBoxText) =>
Show(messageBoxText, "提示", System.Windows.MessageBoxButton.OK, MessageBoxImage.Information, System.Windows.MessageBoxResult.None);
public static System.Windows.MessageBoxResult Warning(string messageBoxText) =>
Show(messageBoxText, "警告", System.Windows.MessageBoxButton.OK, MessageBoxImage.Warning, System.Windows.MessageBoxResult.None);
public static System.Windows.MessageBoxResult Question(string messageBoxText) =>
Show(messageBoxText, "询问", System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Question, System.Windows.MessageBoxResult.None);
public static System.Windows.MessageBoxResult Error(string messageBoxText) =>
Show(messageBoxText, "错误", System.Windows.MessageBoxButton.OK, MessageBoxImage.Error, System.Windows.MessageBoxResult.None);
public static Task<System.Windows.MessageBoxResult> InformationAsync(string messageBoxText) =>
ShowAsync(messageBoxText, "信息", System.Windows.MessageBoxButton.OK, MessageBoxImage.Information, System.Windows.MessageBoxResult.None);
public static Task<System.Windows.MessageBoxResult> WarningAsync(string messageBoxText) =>
ShowAsync(messageBoxText, "警告", System.Windows.MessageBoxButton.OK, MessageBoxImage.Warning, System.Windows.MessageBoxResult.None);
public static Task<System.Windows.MessageBoxResult> QuestionAsync(string messageBoxText) =>
ShowAsync(messageBoxText, "询问", System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Information, System.Windows.MessageBoxResult.None);
public static Task<System.Windows.MessageBoxResult> ErrorAsync(string messageBoxText) =>
ShowAsync(messageBoxText, "错误", System.Windows.MessageBoxButton.OK, MessageBoxImage.Error, System.Windows.MessageBoxResult.None);
}