using CommunityToolkit.Mvvm.ComponentModel; using OpenTap; using OpenTap.Addin; using System.Collections.ObjectModel; using System.Windows; namespace OpenTapEditor { /// /// VariableSelector.xaml 的交互逻辑 /// [ObservableObject] public partial class VariableSelector : Window { [ObservableProperty] private string result; [ObservableProperty] private ObservableCollection variables; public VariableSelector() { DataContext = this; Variables = new ObservableCollection() { 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(); } } }