using System.Windows; using System.Windows.Controls; using Aitex.Common.Util; using Aitex.Core.UI.MVVM; namespace EfemDualSimulator.Views { /// /// SimulatorPMIOView.xaml 的交互逻辑 /// public partial class SimulatorIOPM2View : UserControl { public SimulatorIOPM2View() { InitializeComponent(); DataContext = new IoViewModel(6832, "PMB.PLC", PathManager.GetCfgDir() + "_ioDefinePM.xml", "PMB"); this.IsVisibleChanged += IOView_IsVisibleChanged; } private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e) { if (this.DataContext == null) { } (DataContext as TimerViewModelBase).EnableTimer(IsVisible); } } }