Files
DMS/Helper/NotificationHelper.cs
2025-07-03 12:55:00 +08:00

27 lines
694 B
C#

using CommunityToolkit.Mvvm.Messaging;
using NLog;
using PMSWPF.Enums;
using PMSWPF.Message;
namespace PMSWPF.Helper;
public class NotificationHelper
{
private static readonly ILogger Logger = LogManager.GetCurrentClassLogger();
public static void ShowMessage(string msg, NotificationType notificationType = NotificationType.Info,
bool isGlobal = false)
{
if (notificationType==NotificationType.Error)
{
Logger.Error(msg);
}
else
{
Logger.Info(msg);
}
WeakReferenceMessenger.Default.Send<NotificationMessage>(
new NotificationMessage(msg, notificationType));
}
}