using CommunityToolkit.Mvvm.ComponentModel;
|
using OpenTap;
|
using OpenTap.Addin;
|
using System.Collections.ObjectModel;
|
using System.Windows;
|
|
namespace OpenTapEditor
|
{
|
/// <summary>
|
/// VariableSelector.xaml 的交互逻辑
|
/// </summary>
|
[ObservableObject]
|
public partial class VariableSelector : Window
|
{
|
[ObservableProperty]
|
private string result;
|
|
[ObservableProperty]
|
private ObservableCollection<TestVariable> variables;
|
|
public VariableSelector()
|
{
|
DataContext = this;
|
Variables = new ObservableCollection<TestVariable>() {
|
new TestVariable(){
|
Name = "Locals",
|
Type = TestVariableType.Container
|
},
|
new TestVariable(){
|
Name = "FileGlobals",
|
Type = TestVariableType.Container
|
},
|
new TestVariable(){
|
Name = "StationGlobals",
|
Type = TestVariableType.Container,
|
Children = UIStationGlobalsManager.Instance.Datasource
|
},
|
};
|
InitializeComponent();
|
}
|
|
public bool? Open(TestPlan plan, TestStepList seq)
|
{
|
Variables[0].Children = seq.Variables;
|
Variables[1].Children = plan.Variables;
|
return this.ShowDialog();
|
}
|
|
}
|
}
|