| 1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859 |
- using CommunityToolkit.Mvvm.ComponentModel;
- using CommunityToolkit.Mvvm.Input;
- using GlobalData;
- using System.Windows;
- namespace ConfigFileManager.ViewModels;
- public partial class ConfigFileManagerViewModel : ObservableObject
- {
- public ConfigFileManagerViewModel(DeviceCollection deviceCollection, IDialogService dialogService)
- {
- this.DeviceCollection = deviceCollection;
- _DialogService = dialogService;
- }
- private readonly IDialogService _DialogService;
- [ObservableProperty]
- private DeviceCollection _DeviceCollection;
- [RelayCommand]
- private void Migrate(DeviceInfo_VM deviceInfo)
- {
- IDialogParameters para = new DialogParameters()
- {
- {"Device",deviceInfo }
- };
- this._DialogService.ShowDialog("Migrate", para);
- }
- [RelayCommand]
- private void Update(DeviceInfo_VM deviceInfo)
- {
- deviceInfo.UpdateTime = DateTime.Now;
- MessageBox.Show("Update Success");
- }
- [RelayCommand]
- private void CheckRecipe(DeviceInfo_VM deviceInfo)
- {
- IDialogParameters para = new DialogParameters()
- {
- {"Device",deviceInfo }
- };
- this._DialogService.ShowDialog("Recipe", para);
- }
- [RelayCommand]
- private void CheckConfig(DeviceInfo_VM deviceInfo)
- {
- IDialogParameters para = new DialogParameters()
- {
- {"Device",deviceInfo }
- };
- this._DialogService.ShowDialog("Config", para);
- }
- }
|