将NotificationService抽取成接口,并将所有使用NotificationService全部替换为接口INotificationService

This commit is contained in:
2025-09-04 19:59:35 +08:00
parent bb650e2682
commit 9d446c370e
12 changed files with 95 additions and 31 deletions

View File

@@ -5,6 +5,7 @@ using DMS.Application.DTOs;
using DMS.Application.Interfaces;
using DMS.Core.Enums;
using DMS.Core.Models;
using DMS.WPF.Interfaces;
using DMS.WPF.Services;
using DMS.WPF.ViewModels.Dialogs;
using DMS.WPF.ViewModels.Items;
@@ -13,7 +14,6 @@ using ObservableCollections;
using System.Collections;
using System.Collections.Generic;
using System.Linq;
using DMS.WPF.Interfaces;
namespace DMS.WPF.ViewModels;
@@ -86,10 +86,10 @@ partial class VariableTableViewModel : ViewModelBase, INavigatable
private readonly ISynchronizedView<VariableItemViewModel, VariableItemViewModel> _synchronizedView;
public NotifyCollectionChangedSynchronizedViewList<VariableItemViewModel> VariableItemListView { get; }
private readonly NotificationService _notificationService;
private readonly INotificationService _notificationService;
public VariableTableViewModel(IMapper mapper, IDialogService dialogService, IVariableAppService variableAppService,
DataServices dataServices, NotificationService notificationService)
DataServices dataServices, INotificationService notificationService)
{
_mapper = mapper;
_dialogService = dialogService;
@@ -198,6 +198,7 @@ partial class VariableTableViewModel : ViewModelBase, INavigatable
// 更新数据库中的变量数据
var updateResult = await _variableAppService.UpdateVariableAsync(_mapper.Map<VariableDto>(editedVariable));
if (updateResult > 0)
{
// 更新当前页面显示的数据:找到原数据在集合中的索引并替换