整理控件库
This commit is contained in:
@@ -5,41 +5,7 @@ namespace WPFluent.Extensions;
|
||||
|
||||
public static class MessageExtensions
|
||||
{
|
||||
private static readonly IContentDialogService ContentDialogService = new ContentDialogService();
|
||||
private static readonly SnackbarService SnackbarService = new();
|
||||
|
||||
public static void ShowCaution(this SnackbarPresenter SnackbarPresenter, string title, string message)
|
||||
{
|
||||
SnackbarService.SetSnackbarPresenter(SnackbarPresenter);
|
||||
SnackbarService.Show(
|
||||
title,
|
||||
message,
|
||||
ControlAppearance.Caution,
|
||||
new SymbolIcon(SymbolRegular.Question16),
|
||||
SnackbarService.DefaultTimeOut);
|
||||
}
|
||||
|
||||
public static void ShowDanger(this SnackbarPresenter SnackbarPresenter, string title, string message)
|
||||
{
|
||||
SnackbarService.SetSnackbarPresenter(SnackbarPresenter);
|
||||
SnackbarService.Show(
|
||||
title,
|
||||
message,
|
||||
ControlAppearance.Danger,
|
||||
new SymbolIcon(SymbolRegular.Alert12),
|
||||
SnackbarService.DefaultTimeOut);
|
||||
}
|
||||
|
||||
public static void ShowInfo(this SnackbarPresenter SnackbarPresenter, string title, string message)
|
||||
{
|
||||
SnackbarService.SetSnackbarPresenter(SnackbarPresenter);
|
||||
SnackbarService.Show(
|
||||
title,
|
||||
message,
|
||||
ControlAppearance.Info,
|
||||
new SymbolIcon(SymbolRegular.Info12),
|
||||
SnackbarService.DefaultTimeOut);
|
||||
}
|
||||
private static readonly ContentDialogService ContentDialogService = new ContentDialogService();
|
||||
|
||||
public static async void ShowMessage(string content = "内容...", string title = "消息")
|
||||
{
|
||||
@@ -70,7 +36,7 @@ public static class MessageExtensions
|
||||
string closeButtonText = "关闭")
|
||||
{
|
||||
return await ContentDialogService.ShowSimpleDialogAsync(
|
||||
new SimpleContentDialogCreateOptions()
|
||||
new SimpleContentDialogOptions()
|
||||
{
|
||||
Title = title,
|
||||
Content = content,
|
||||
|
||||
Reference in New Issue
Block a user