FFUControlView.xaml.cs 833 B

123456789101112131415161718192021222324252627282930
  1. using System.Windows;
  2. using System.Windows.Controls;
  3. using Aitex.Core.Util;
  4. using Aitex.Sorter.Common;
  5. using Aitex.Sorter.UI.ViewModel;
  6. using SorterUI.Controls;
  7. using SorterUI.ViewModels.Maintenance;
  8. namespace SorterUI.Views.Maintenance
  9. {
  10. public partial class FFUControlView : UserControl
  11. {
  12. public FFUControlViewModel _ffuControlViewModel;
  13. public FFUControlView()
  14. {
  15. InitializeComponent();
  16. _ffuControlViewModel = new FFUControlViewModel();
  17. DataContext = _ffuControlViewModel;
  18. IsVisibleChanged += ffuControlView_IsVisibleChanged;
  19. }
  20. private void ffuControlView_IsVisibleChanged(object sender, DependencyPropertyChangedEventArgs e)
  21. {
  22. (DataContext as FFUControlViewModel)?.EnableTimer(IsVisible);
  23. }
  24. }
  25. }