HidAllSeriesCommand.cs 867 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Input;
  6. using Aitex.UI.Charting.ViewModel;
  7. using System.Windows;
  8. using Aitex.UI.Charting.Model;
  9. using Abt.Controls.SciChart;
  10. namespace Aitex.UI.Charting.Command
  11. {
  12. public class HidAllSeriesCommand : ICommand
  13. {
  14. public HidAllSeriesCommand()
  15. {
  16. }
  17. public bool CanExecute(object parameter)
  18. {
  19. return true;
  20. }
  21. #pragma warning disable 0067
  22. public event EventHandler CanExecuteChanged;
  23. #pragma warning restore 0067
  24. public void Execute(object parameter)
  25. {
  26. var commonViewModel = (CommonViewModel)parameter;
  27. foreach (var series in commonViewModel.RenderableSeries)
  28. {
  29. series.IsVisible = false;
  30. }
  31. }
  32. }
  33. }