将NlogHelper,和NotificationHelper,改为服务的方式注入使用

This commit is contained in:
2025-09-04 17:29:24 +08:00
parent c45287fae0
commit bb650e2682
35 changed files with 307 additions and 474 deletions

View File

@@ -2,8 +2,8 @@ using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Media;
using DMS.Helper;
using DMS.WPF.ViewModels;
using DMS.WPF.Services;
using iNKORE.UI.WPF.Modern.Controls;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Logging;
@@ -39,7 +39,8 @@ public partial class VariableTableView : UserControl
}
catch (Exception exception)
{
NotificationHelper.ShowError($"修改变量表启用,停用时发生了错误:{exception.Message}", exception);
var notificationService = App.Current.Services.GetRequiredService<NotificationService>();
notificationService.ShowError($"修改变量表启用,停用时发生了错误:{exception.Message}", exception);
}
}
@@ -47,6 +48,5 @@ public partial class VariableTableView : UserControl
{
IsLoadCompletion = true;
}
}