SimulatorIoTMSEView.xaml.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940
  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 Venus_Core;
  11. using Venus_Simulator.Instances;
  12. namespace Venus_Simulator.Views
  13. {
  14. /// <summary>
  15. /// IoView.xaml 的交互逻辑
  16. /// </summary>
  17. public partial class SimulatorIoTMSEView : UserControl
  18. {
  19. public SimulatorIoTMSEView()
  20. {
  21. InitializeComponent();
  22. DataContext = new IoViewModel(6832, "TMSE.PLC", PathManager.GetCfgDir() + $"_ioDefineVenusSE_MF.xml", "TMSE");
  23. this.IsVisibleChanged += IOView_IsVisibleChanged;
  24. }
  25. private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  26. {
  27. if (this.DataContext == null)
  28. {
  29. }
  30. (DataContext as TimerViewModelBase).EnableTimer(IsVisible);
  31. }
  32. }
  33. }