完成添加变量功能
This commit is contained in:
@@ -1,4 +1,5 @@
|
||||
using iNKORE.UI.WPF.Modern.Controls;
|
||||
using NPOI.SS.Formula.Functions;
|
||||
using PMSWPF.Models;
|
||||
using PMSWPF.ViewModels.Dialogs;
|
||||
using PMSWPF.Views.Dialogs;
|
||||
@@ -56,7 +57,7 @@ public class DialogService :IDialogService
|
||||
return false;
|
||||
}
|
||||
|
||||
public async Task<VariableTable> ShowAddVarTableDialog(Device device)
|
||||
public async Task<VariableTable> ShowAddVarTableDialog()
|
||||
{
|
||||
VarTableDialogViewModel vm = new();
|
||||
vm.Title = "添加变量表";
|
||||
@@ -70,6 +71,21 @@ public class DialogService :IDialogService
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
public async Task<VariableData> ShowAddVarDataDialog()
|
||||
{
|
||||
VarDataDialogViewModel vm = new();
|
||||
vm.Title = "添加变量";
|
||||
vm.PrimaryButtonText = "添加变量";
|
||||
vm.VariableData = new VariableData();
|
||||
var dialog = new VarDataDialog(vm);
|
||||
var res = await dialog.ShowAsync();
|
||||
if (res == ContentDialogResult.Primary)
|
||||
{
|
||||
return vm.VariableData;
|
||||
}
|
||||
return null;
|
||||
}
|
||||
|
||||
|
||||
public void ShowMessageDialog(string title, string message)
|
||||
|
||||
@@ -9,7 +9,9 @@ public interface IDialogService
|
||||
|
||||
Task<bool> ShowConfrimeDialog(string title, string message,string buttonText="确认");
|
||||
|
||||
Task<VariableTable> ShowAddVarTableDialog(Device device);
|
||||
Task<VariableTable> ShowAddVarTableDialog();
|
||||
|
||||
Task<VariableData> ShowAddVarDataDialog();
|
||||
|
||||
void ShowMessageDialog(string title, string message);
|
||||
}
|
||||
Reference in New Issue
Block a user