SimulatorIO2View.xaml.cs 857 B

12345678910111213141516171819202122232425262728293031
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using Aitex.Common.Util;
  4. using Aitex.Core.UI.MVVM;
  5. namespace MECF.Framework.Simulator.Core.IoProviders
  6. {
  7. /// <summary>
  8. /// IoView.xaml 的交互逻辑
  9. /// </summary>
  10. public partial class SimulatorIO2View : UserControl
  11. {
  12. public SimulatorIO2View()
  13. {
  14. InitializeComponent();
  15. DataContext = new IOViewModel(6732, "System.io2", PathManager.GetCfgDir() + "_ioDefine2.xml");
  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. }