Files
WCS/Cowain.Base/Helpers/NotificationHelper.cs
2026-03-02 09:08:20 +08:00

31 lines
943 B
C#

using Avalonia.Controls.Notifications;
using Notification = Ursa.Controls.Notification;
using WindowNotificationManager = Ursa.Controls.WindowNotificationManager;
namespace Cowain.Base.Helpers;
public static class NotificationHelper
{
public static WindowNotificationManager? NotificationManager { get; set; }
public static void ShowNormal(NotificationType notificationType, string message)
{
NotificationManager?.Show(
new Notification(notificationType.ToString(), message),
showIcon: true,
showClose: true,
type: notificationType);
}
public static void ShowLight(NotificationType notificationType, string message)
{
NotificationManager?.Show(
new Notification(notificationType.ToString(), message),
showIcon: true,
showClose: true,
type: notificationType,
classes: ["Light"]);
}
}