SimulatorIoSETMView.xaml.cs 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using Aitex.Common.Util;
  2. using Aitex.Core.UI.MVVM;
  3. using System;
  4. using System.Collections.Generic;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows;
  9. using System.Windows.Controls;
  10. using System.Windows.Data;
  11. using System.Windows.Documents;
  12. using System.Windows.Input;
  13. using System.Windows.Media;
  14. using System.Windows.Media.Imaging;
  15. using System.Windows.Navigation;
  16. using System.Windows.Shapes;
  17. namespace CyberX8_Simulator.Views
  18. {
  19. /// <summary>
  20. /// SimulatorIoSETMView.xaml 的交互逻辑
  21. /// </summary>
  22. public partial class SimulatorIoSETMView : UserControl
  23. {
  24. public SimulatorIoSETMView()
  25. {
  26. InitializeComponent();
  27. DataContext = new IoViewModel(6832, "SETM.PLC", PathManager.GetCfgDir() + $"_ioDefineVenusSE_MF.xml", "SETM");
  28. this.IsVisibleChanged += IOView_IsVisibleChanged;
  29. }
  30. private void IOView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  31. {
  32. if (this.DataContext == null)
  33. {
  34. }
  35. (DataContext as TimerViewModelBase).EnableTimer(IsVisible);
  36. }
  37. }
  38. }