2025-06-12 13:15:55 +08:00
|
|
|
|
using CommunityToolkit.Mvvm.Input;
|
|
|
|
|
|
using PMSWPF.Models;
|
|
|
|
|
|
using PMSWPF.Services;
|
|
|
|
|
|
using PMSWPF.ViewModels.Dialogs;
|
|
|
|
|
|
using PMSWPF.Views.Dialogs;
|
2025-06-10 20:55:39 +08:00
|
|
|
|
|
2025-06-12 13:15:55 +08:00
|
|
|
|
namespace PMSWPF.ViewModels;
|
|
|
|
|
|
|
|
|
|
|
|
public partial class DevicesViewModel : ViewModelBase
|
2025-06-10 20:55:39 +08:00
|
|
|
|
{
|
2025-06-12 13:15:55 +08:00
|
|
|
|
private readonly IDeviceDialogService _deviceDialogService;
|
|
|
|
|
|
|
|
|
|
|
|
public DevicesViewModel(IDeviceDialogService deviceDialogService)
|
|
|
|
|
|
{
|
|
|
|
|
|
_deviceDialogService = deviceDialogService;
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
[RelayCommand]
|
|
|
|
|
|
public async void AddDevice()
|
2025-06-10 22:13:06 +08:00
|
|
|
|
{
|
2025-06-12 13:15:55 +08:00
|
|
|
|
Device device = new Device();
|
|
|
|
|
|
await _deviceDialogService.ShowAddDeviceDialog(device);
|
2025-06-10 22:13:06 +08:00
|
|
|
|
}
|
2025-06-10 20:55:39 +08:00
|
|
|
|
}
|