将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

@@ -1,6 +1,5 @@
// 文件: DMS.WPF/Services/NavigationService.cs
using DMS.Helper;
using DMS.ViewModels;
using DMS.WPF.ViewModels;
using DMS.WPF.ViewModels.Items;
@@ -11,6 +10,7 @@ using System.Collections.Generic;
using System.Threading.Tasks;
using System.Windows;
using DMS.WPF.Interfaces;
using DMS.WPF.Services;
namespace DMS.WPF.Services;
@@ -43,8 +43,8 @@ public class NavigationService : INavigationService
var viewModel = GetViewModelByKey(menu.TargetViewKey);
if (viewModel == null)
{
NotificationHelper.ShowError($"切换界面失败,没有找到界面:{menu.TargetViewKey}");
var notificationService = App.Current.Services.GetRequiredService<NotificationService>();
notificationService.ShowError($"切换界面失败,没有找到界面:{menu.TargetViewKey}");
return;
}