重构了代码

This commit is contained in:
2025-07-02 22:07:16 +08:00
parent 31f6cf64f4
commit b6519ae0b1
16 changed files with 326 additions and 294 deletions

View File

@@ -1,4 +1,5 @@
using CommunityToolkit.Mvvm.Messaging;
using NLog;
using PMSWPF.Enums;
using PMSWPF.Message;
@@ -6,9 +7,19 @@ 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));
}