SimulatorIOSystemView.xaml.cs 841 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 SimulatorIOSystemView : UserControl
  11. {
  12. public SimulatorIOSystemView()
  13. {
  14. InitializeComponent();
  15. DataContext = new IoViewModel(6831, "System.PLC", PathManager.GetCfgDir() + "_ioDefineMF.xml", "System");
  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. }