This commit is contained in:
GG Z
2025-07-31 20:12:24 +08:00
parent 4f6cd2137c
commit f209e7d3ad
426 changed files with 15854 additions and 6612 deletions

View File

@@ -0,0 +1,87 @@
using System.ComponentModel.Composition;
using AntDesignWPF.Controls;
using Caliburn.Micro;
namespace AntdWpfDemo.ViewModels
{
[Export(typeof(IScreen))]
internal class NotificationViewModel : Screen
{
public NotificationViewModel()
{
DisplayName = "Notification";
}
public void SuccessClick()
{
NotificationManager.Show(
"操作成功",
"您的设置已保存,并已成功应用到系统中。",
NotificationType.Success);
}
public void InfoClick()
{
NotificationManager.Show(
"系统提示",
"这是一条普通的信息提示,用于通知用户。",
NotificationType.Info,
NotificationPlacement.BottomRight);
}
public void WarningClick()
{
NotificationManager.Show(
"警告",
"您的磁盘空间即将用尽,请及时清理文件。",
NotificationType.Warning,
NotificationPlacement.BottomLeft);
}
public void ErrorClick()
{
NotificationManager.Show(
"发生错误",
"无法连接到服务器,请检查您的网络连接。",
NotificationType.Error,
NotificationPlacement.TopLeft,
durationSeconds: 5); // 自定义持续时间
}
public void thisSuccessClick()
{
NotificationManager.Show(
"操作成功",
"您的设置已保存,并已成功应用到系统中。",
NotificationType.Success);
}
public void thisInfoClick()
{
NotificationManager.Show(
"系统提示",
"这是一条普通的信息提示,用于通知用户。",
NotificationType.Info,
NotificationPlacement.BottomRight);
}
public void thisWarningClick()
{
NotificationManager.Show(
"警告",
"您的磁盘空间即将用尽,请及时清理文件。",
NotificationType.Warning,
NotificationPlacement.BottomLeft);
}
public void thisErrorClick()
{
NotificationManager.Show(
"发生错误",
"无法连接到服务器,请检查您的网络连接。",
NotificationType.Error,
NotificationPlacement.TopLeft,
durationSeconds: 5); // 自定义持续时间
}
}
}