SimulatorIo3View.xaml.cs 1.1 KB

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 CyberX8_Simulator.Instances;
  11. namespace CyberX8_Simulator.Views
  12. {
  13. /// <summary>
  14. /// IoView.xaml 的交互逻辑
  15. /// </summary>
  16. public partial class SimulatorIo3View : UserControl
  17. {
  18. public SimulatorIo3View()
  19. {
  20. InitializeComponent();
  21. DataContext = new IoViewModel(6733, "PMC.PLC", PathManager.GetCfgDir() + $"_ioDefine{SimulatorJetChamber.CurrentPMCChamber}.xml", "PMC");
  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. }