重构了代码
This commit is contained in:
@@ -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));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user