修复了添加设备的一些问题
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using PMSWPF.Models;
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using PMSWPF.Models;
|
||||
using PMSWPF.ViewModels.Dialogs;
|
||||
using PMSWPF.Views.Dialogs;
|
||||
|
||||
@@ -6,15 +7,24 @@ namespace PMSWPF.Services;
|
||||
|
||||
public class DeviceDialogService : IDeviceDialogService
|
||||
{
|
||||
public async Task<Device> ShowAddDeviceDialog(Device device)
|
||||
public async Task<Device> ShowAddDeviceDialog()
|
||||
{
|
||||
Device device = new Device();
|
||||
DeviceDialogViewModel ddvm = new DeviceDialogViewModel(device)
|
||||
{
|
||||
Title = "添加设备"
|
||||
};
|
||||
|
||||
DeviceDialog dialog = new DeviceDialog(ddvm);
|
||||
await dialog.ShowAsync();
|
||||
return device;
|
||||
var res=await dialog.ShowAsync();
|
||||
if (res == ContentDialogResult.Primary)
|
||||
{
|
||||
return device;
|
||||
}
|
||||
else
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user