TabStatisticView.xaml.cs 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows;
  6. using System.Windows.Controls;
  7. using System.Windows.Data;
  8. using System.Windows.Documents;
  9. using System.Windows.Input;
  10. using System.Windows.Media;
  11. using System.Windows.Media.Imaging;
  12. using System.Windows.Navigation;
  13. using System.Windows.Shapes;
  14. using Aitex.UI.Charting.ViewModel;
  15. namespace Aitex.UI.Charting.View
  16. {
  17. /// <summary>
  18. /// Interaction logic for TabStatisticView.xaml
  19. /// </summary>
  20. public partial class TabStatisticView : UserControl
  21. {
  22. public TabStatisticView()
  23. {
  24. InitializeComponent();
  25. _viewModel = new TabStatisticViewModel();
  26. grid1.DataContext = _viewModel;
  27. IsVisibleChanged += new DependencyPropertyChangedEventHandler(TabStatisticView_IsVisibleChanged);
  28. }
  29. /// <summary>
  30. /// 当切换该页面时自动打开显示垂直时间标尺
  31. /// </summary>
  32. /// <param name="sender"></param>
  33. /// <param name="e"></param>
  34. void TabStatisticView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  35. {
  36. bool flag = (bool)e.NewValue;
  37. if (flag) _viewModel.Start();
  38. else _viewModel.Stop();
  39. }
  40. private TabStatisticViewModel _viewModel;
  41. }
  42. }