清理引用,将NavigatorServices更改为使用Message来实现导航的切换
This commit is contained in:
@@ -1,30 +1,28 @@
|
||||
using CommunityToolkit.Mvvm.ComponentModel;
|
||||
using CommunityToolkit.Mvvm.Input;
|
||||
using PMSWPF.Enums;
|
||||
using PMSWPF.Extensions;
|
||||
using PMSWPF.Models;
|
||||
|
||||
namespace PMSWPF.ViewModels.Dialogs;
|
||||
|
||||
public partial class DeviceDialogViewModel:ObservableObject
|
||||
public partial class DeviceDialogViewModel : ObservableObject
|
||||
{
|
||||
private readonly Device _saveDevice;
|
||||
|
||||
[ObservableProperty]
|
||||
private string title="添加设备";
|
||||
[ObservableProperty]
|
||||
private Device device;
|
||||
[ObservableProperty] private Device device;
|
||||
|
||||
[ObservableProperty] private string title = "添加设备";
|
||||
|
||||
public DeviceDialogViewModel(Device saveDevice)
|
||||
{
|
||||
_saveDevice = saveDevice;
|
||||
this.device = new Device();
|
||||
device = new Device();
|
||||
}
|
||||
|
||||
|
||||
[RelayCommand]
|
||||
public void AddDevice()
|
||||
{
|
||||
this.device.CopyTo<Device>(_saveDevice);
|
||||
device.CopyTo<Device>(_saveDevice);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user