SimulatorIOPM2View.xaml.cs 829 B

1234567891011121314151617181920212223242526272829303132
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using Aitex.Common.Util;
  4. using Aitex.Core.UI.MVVM;
  5. namespace EfemDualSimulator.Views
  6. {
  7. /// <summary>
  8. /// SimulatorPMIOView.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class SimulatorIOPM2View : UserControl
  11. {
  12. public SimulatorIOPM2View()
  13. {
  14. InitializeComponent();
  15. DataContext = new IoViewModel(6832, "PMB.PLC", PathManager.GetCfgDir() + "_ioDefinePM.xml", "PMB");
  16. this.IsVisibleChanged += IOView_IsVisibleChanged;
  17. }
  18. private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  19. {
  20. if (this.DataContext == null)
  21. {
  22. }
  23. (DataContext as TimerViewModelBase).EnableTimer(IsVisible);
  24. }
  25. }
  26. }