SimulatorIo2View.xaml.cs 1010 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.ObjectModel;
  3. using System.Windows;
  4. using System.Windows.Controls;
  5. using System.Windows.Controls.Primitives;
  6. using System.Windows.Data;
  7. using Aitex.Common.Util;
  8. using Aitex.Core.UI.MVVM;
  9. using MECF.Framework.Common.IOCore;
  10. using EfemDualSimulator.Instances;
  11. namespace EfemDualSimulator.Views
  12. {
  13. /// <summary>
  14. /// IoView.xaml 的交互逻辑
  15. /// </summary>
  16. public partial class SimulatorIo2View : UserControl
  17. {
  18. public SimulatorIo2View()
  19. {
  20. InitializeComponent();
  21. DataContext = new IoViewModel(6732, "PMB.PLC", PathManager.GetCfgDir() + "_ioDefineVirgo.xml", "PMB");
  22. this.IsVisibleChanged += IOView_IsVisibleChanged;
  23. }
  24. private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  25. {
  26. if (this.DataContext == null)
  27. {
  28. }
  29. (DataContext as TimerViewModelBase).EnableTimer(IsVisible);
  30. }
  31. }
  32. }