实现了添加设备的弹出对话框,未完成对话框的内容

This commit is contained in:
2025-06-12 13:15:55 +08:00
parent bcfa3df3d3
commit ea15ea594a
10 changed files with 181 additions and 19 deletions

View File

@@ -1,12 +1,25 @@
namespace PMSWPF.ViewModels;
using CommunityToolkit.Mvvm.Input;
using PMSWPF.Models;
using PMSWPF.Services;
using PMSWPF.ViewModels.Dialogs;
using PMSWPF.Views.Dialogs;
public class DevicesViewModel:ViewModelBase
namespace PMSWPF.ViewModels;
public partial class DevicesViewModel : ViewModelBase
{
public DevicesViewModel()
private readonly IDeviceDialogService _deviceDialogService;
public DevicesViewModel(IDeviceDialogService deviceDialogService)
{
_deviceDialogService = deviceDialogService;
}
[RelayCommand]
public async void AddDevice()
{
Device device = new Device();
await _deviceDialogService.ShowAddDeviceDialog(device);
}
}