This commit is contained in:
2025-10-20 19:39:17 +08:00
parent 01adc11be7
commit 7ad1b7d5e1
29 changed files with 113 additions and 140 deletions

View File

@@ -20,7 +20,7 @@ public partial class DeviceDetailViewModel : ViewModelBase
{
private readonly IMapper _mapper;
private readonly IDialogService _dialogService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly INavigationService _navigationService;
private readonly IWPFDataService _wpfDataService;
@@ -36,7 +36,7 @@ public partial class DeviceDetailViewModel : ViewModelBase
private readonly INotificationService _notificationService;
public DeviceDetailViewModel(IMapper mapper, IDialogService dialogService, IDataStorageService dataStorageService,
public DeviceDetailViewModel(IMapper mapper, IDialogService dialogService, IWpfDataService dataStorageService,
INavigationService navigationService,
IWPFDataService wpfDataService, INotificationService notificationService)
{
@@ -207,7 +207,7 @@ public partial class DeviceDetailViewModel : ViewModelBase
public void NavigateToVariableTable()
{
if (SelectedVariableTable == null) return;
// var menu = _dataStorageService.Menus.FirstOrDefault(m => m.MenuType == MenuType.VariableTableMenu &&
// var menu = _wpfDataService.Menus.FirstOrDefault(m => m.MenuType == MenuType.VariableTableMenu &&
// m.TargetId == SelectedVariableTable.Id);
// if (menu == null) return;
_navigationService.NavigateToAsync(

View File

@@ -24,7 +24,7 @@ public partial class DevicesViewModel : ViewModelBase, INavigatable
private readonly IWPFDataService _wpfDataService;
private readonly IDeviceAppService _deviceAppService;
private readonly IMapper _mapper;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly IDialogService _dialogService;
private readonly INavigationService _navigationService;
@@ -54,7 +54,7 @@ public partial class DevicesViewModel : ViewModelBase, INavigatable
/// <param name="wpfDataService">主数据服务。</param>
/// <param name="deviceAppService">设备应用服务。</param>
/// <param name="notificationService">通知服务。</param>
public DevicesViewModel(IMapper mapper, IDataStorageService dataStorageService,
public DevicesViewModel(IMapper mapper, IWpfDataService dataStorageService,
IDialogService dialogService, INavigationService navigationService,
IWPFDataService wpfDataService, IDeviceAppService deviceAppService,
INotificationService notificationService)

View File

@@ -21,7 +21,7 @@ namespace DMS.WPF.ViewModels.Dialogs
{
private readonly IDialogService _dialogService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly INotificationService _notificationService;
[ObservableProperty]
@@ -39,7 +39,7 @@ namespace DMS.WPF.ViewModels.Dialogs
public TriggerDialogViewModel(
IDialogService dialogService,
IDataStorageService dataStorageService,
IWpfDataService dataStorageService,
INotificationService notificationService)
{
_dialogService = dialogService ?? throw new ArgumentNullException(nameof(dialogService));

View File

@@ -26,11 +26,11 @@ public partial class VariableDialogViewModel : DialogViewModelBase<VariableItem>
private bool _hasError;
private readonly IWPFDataService _wpfDataService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly IVariableAppService _variableAppService;
private readonly IMapper _mapper;
public VariableDialogViewModel(IWPFDataService wpfDataService,IDataStorageService dataStorageService, IVariableAppService variableAppService, IMapper mapper)
public VariableDialogViewModel(IWPFDataService wpfDataService,IWpfDataService dataStorageService, IVariableAppService variableAppService, IMapper mapper)
{
Variable = new VariableItem();

View File

@@ -28,7 +28,7 @@ partial class LogHistoryViewModel : ViewModelBase,IDisposable
private readonly IMapper _mapper;
private readonly INlogAppService _nlogAppService;
private readonly IDialogService _dialogService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly INotificationService _notificationService;
private readonly IAppCenterService _appCenterService;
@@ -50,7 +50,7 @@ partial class LogHistoryViewModel : ViewModelBase,IDisposable
public ObservableCollection<string> LogLevels { get; } = new ObservableCollection<string> { "Trace", "Debug", "Info", "Warn", "Error", "Fatal" };
public LogHistoryViewModel(IMapper mapper, INlogAppService nlogAppService, IDialogService dialogService, IDataStorageService dataStorageService
public LogHistoryViewModel(IMapper mapper, INlogAppService nlogAppService, IDialogService dialogService, IWpfDataService dataStorageService
, INotificationService notificationService, IWPFDataService wpfDataService, IAppCenterService appCenterService)
{
_mapper = mapper;

View File

@@ -22,7 +22,7 @@ public partial class MainViewModel : ViewModelBase
{
private readonly IDialogService _dialogService;
private readonly IWPFDataService _wpfDataService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly INavigationService _navigationService;
private readonly ILogger<MainViewModel> _logger;
@@ -46,7 +46,7 @@ public partial class MainViewModel : ViewModelBase
/// <param name="dialogService">对话框服务。</param>
/// <param name="logger">日志记录器。</param>
/// <param name="wpfDataService"></param>
public MainViewModel(IWPFDataService wpfDataService ,IDataStorageService dataStorageService,INavigationService navigationService,
public MainViewModel(IWPFDataService wpfDataService ,IWpfDataService dataStorageService,INavigationService navigationService,
ILogger<MainViewModel> logger)
{
_wpfDataService = wpfDataService;

View File

@@ -26,7 +26,7 @@ namespace DMS.WPF.ViewModels
private readonly IMqttManagementService _mqttManagementService;
private readonly IMqttAliasDataService _mqttAliasDataService;
private readonly IWPFDataService _wpfDataService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly INavigationService _navigationService;
/// <summary>
@@ -61,7 +61,7 @@ namespace DMS.WPF.ViewModels
IMqttManagementService mqttManagementService,
IMqttAliasDataService mqttAliasDataService,
IWPFDataService wpfDataService,
IDataStorageService dataStorageService,
IWpfDataService dataStorageService,
INavigationService navigationService)
{
_logger = logger;

View File

@@ -23,7 +23,7 @@ public partial class MqttsViewModel : ViewModelBase
{
private readonly IWPFDataService _wpfDataService;
private readonly IMqttAppService _mqttAppService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly IMapper _mapper;
private readonly IDialogService _dialogService;
private readonly INavigationService _navigationService;
@@ -49,7 +49,7 @@ public partial class MqttsViewModel : ViewModelBase
IDialogService dialogService,
IWPFDataService wpfDataService,
IMqttAppService mqttAppService,
IDataStorageService dataStorageService,
IWpfDataService dataStorageService,
IMapper mapper,
INavigationService navigationService,
INotificationService notificationService

View File

@@ -24,7 +24,7 @@ namespace DMS.WPF.ViewModels
private readonly INotificationService _notificationService;
private readonly ITriggerManagementService _triggerManagementService;
private readonly ITriggerDataService _triggerDataService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly INavigationService _navigationService;
/// <summary>
@@ -52,7 +52,7 @@ namespace DMS.WPF.ViewModels
INotificationService notificationService,
ITriggerManagementService triggerManagementService,
ITriggerDataService triggerDataService,
IDataStorageService dataStorageService,
IWpfDataService dataStorageService,
INavigationService navigationService)
{
_logger = logger;

View File

@@ -21,7 +21,7 @@ namespace DMS.WPF.ViewModels
{
private readonly IMapper _mapper;
private readonly ITriggerDataService _triggerDataService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly IDialogService _dialogService;
private readonly INotificationService _notificationService;
private readonly INavigationService _navigationService;
@@ -38,7 +38,7 @@ namespace DMS.WPF.ViewModels
public TriggersViewModel(
IMapper mapper,
ITriggerDataService triggerDataService,
IDataStorageService dataStorageService,
IWpfDataService dataStorageService,
IDialogService dialogService,
INotificationService notificationService,
INavigationService navigationService)

View File

@@ -27,7 +27,7 @@ partial class VariableHistoryViewModel : ViewModelBase, INavigatable
private readonly IDialogService _dialogService;
private readonly IHistoryAppService _historyAppService;
private readonly IWPFDataService _wpfDataService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly IEventService _eventService;
private readonly INotificationService _notificationService;
private readonly INavigationService _navigationService;
@@ -85,7 +85,7 @@ partial class VariableHistoryViewModel : ViewModelBase, INavigatable
private List<VariableHistoryDto> _allVariableHistories;
public VariableHistoryViewModel(IMapper mapper, IDialogService dialogService, IHistoryAppService historyAppService,
IWPFDataService wpfDataService, IDataStorageService dataStorageService,
IWPFDataService wpfDataService, IWpfDataService dataStorageService,
IEventService eventService, INotificationService notificationService,
INavigationService navigationService)
{

View File

@@ -85,7 +85,7 @@ partial class VariableTableViewModel : ViewModelBase, INavigatable
/// <param name="dialogService">对话服务接口的实例。</param>
private readonly IWPFDataService _wpfDataService;
private readonly IDataStorageService _dataStorageService;
private readonly IWpfDataService _dataStorageService;
private readonly ObservableList<VariableItem> _variableItemList;
private readonly ISynchronizedView<VariableItem, VariableItem> _synchronizedView;
@@ -99,7 +99,7 @@ partial class VariableTableViewModel : ViewModelBase, INavigatable
public VariableTableViewModel(IMapper mapper, IDialogService dialogService, IVariableManagementService variableManagementService,
IEventService eventService,
IMqttAliasAppService mqttAliasAppService, IMqttAppService mqttAppService,
IWPFDataService wpfDataService, IDataStorageService dataStorageService,
IWPFDataService wpfDataService, IWpfDataService dataStorageService,
INotificationService notificationService, ITriggerAppService triggerAppService,
ITriggerVariableAppService triggerVariableAppService)
{