Files
Shrlalgo.RvKits/WPFluent/Controls/MessageBox/MessageBox.Image.cs
ShrlAlgo 4d35cadb56 更新
2025-07-11 09:20:23 +08:00

30 lines
2.0 KiB
C#

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);
}