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 InformationAsync(string messageBoxText) => ShowAsync(messageBoxText, "信息", System.Windows.MessageBoxButton.OK, MessageBoxImage.Information, System.Windows.MessageBoxResult.None); public static Task WarningAsync(string messageBoxText) => ShowAsync(messageBoxText, "警告", System.Windows.MessageBoxButton.OK, MessageBoxImage.Warning, System.Windows.MessageBoxResult.None); public static Task QuestionAsync(string messageBoxText) => ShowAsync(messageBoxText, "询问", System.Windows.MessageBoxButton.YesNo, MessageBoxImage.Information, System.Windows.MessageBoxResult.None); public static Task ErrorAsync(string messageBoxText) => ShowAsync(messageBoxText, "错误", System.Windows.MessageBoxButton.OK, MessageBoxImage.Error, System.Windows.MessageBoxResult.None); }