SimulatorPMIOView.xaml.cs 1.3 KB

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