using CommunityToolkit.Mvvm.ComponentModel; using NationalInstruments.TestStand.Interop.API; using Plugin.SeqEditor.Entity; using Plugin.SeqEditor.Util; using System.ComponentModel; using System.Windows.Controls; namespace Plugin.SeqEditor.SettingPanel { /// /// CommonProperty.xaml 的交互逻辑 /// [INotifyPropertyChanged] public partial class LoopPanel : UserControl { public event EventHandler SettingChanged; private StepUI stepUI; public StepUI StepUI { get => stepUI; set { this.stepUI = stepUI; this.step = stepUI.step; propertyObject = this.step?.AsPropertyObject(); this.DataContext = stepUI; } } public Step step; public PropertyObject propertyObject; protected void CustomPropertyChanged(string name) { OnPropertyChanged(name); SettingChanged?.Invoke(this, EventArgs.Empty); } public LoopPanel() { InitializeComponent(); CbLoopType.ItemsSource = LoopTypeData.ItemSource; CBLoopCondition.ItemsSource = LoopConditionData.ItemSource; CBLoopCondition2.ItemsSource = LoopCondition2Data.ItemSource; } public LoopPanel(StepUI stepUI) { this.stepUI = stepUI; this.step = stepUI.step; propertyObject = this.step?.AsPropertyObject(); this.DataContext = stepUI; InitializeComponent(); CbLoopType.ItemsSource = LoopTypeData.ItemSource; CBLoopCondition.ItemsSource = LoopConditionData.ItemSource; CBLoopCondition2.ItemsSource = LoopCondition2Data.ItemSource; } } }