Files
DMS/Helper/NotificationHelper.cs

26 lines
689 B
C#
Raw Normal View History

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