DataSeriesViewModel.cs 1.9 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  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.Command;
  7. using System.Windows;
  8. namespace Aitex.UI.Charting.ViewModel
  9. {
  10. public class DataSeriesViewModel : ChartingBaseViewModel
  11. {
  12. public ICommand ShowAllSeriesCommand { get; set; }
  13. public ICommand HidAllSeriesCommand { get; set; }
  14. public ICommand DeleteAllSeriesCommand { get; set; }
  15. public ICommand LoadPresetSettingCommand { get; set; }
  16. public ICommand ExportAllSeriesCommand { get; set; }
  17. public CommonViewModel CommonViewModel { get; set; }
  18. public DataSeriesViewModel()
  19. {
  20. CommonViewModel = CommonViewModel.Instance;
  21. ShowAllSeriesCommand = new ChartingCommand((o) => true, (o) =>
  22. {
  23. CommonViewModel.ShowAllSeries();
  24. });
  25. HidAllSeriesCommand = new ChartingCommand((o) => true, (o) =>
  26. {
  27. CommonViewModel.HidAllSeries();
  28. });
  29. DeleteAllSeriesCommand = new ChartingCommand((o) => true, (o) =>
  30. {
  31. if (MessageBox.Show(DataAnalysisControl.Properties.Resource.DataSeriesViewModel_DataSeriesViewModel_deleteAllSeries, DataAnalysisControl.Properties.Resource.DataSeriesViewModel_DataSeriesViewModel_DeleteDta, MessageBoxButton.YesNo, MessageBoxImage.Question) == MessageBoxResult.Yes)
  32. {
  33. CommonViewModel.RemoveDataSeries(string.Empty);
  34. }
  35. });
  36. LoadPresetSettingCommand = new ChartingCommand((o) => true, (o) =>
  37. {
  38. CommonViewModel.LoadPresetSetting();
  39. });
  40. ExportAllSeriesCommand = new ChartingCommand((o) => true, (o) =>
  41. {
  42. CommonViewModel.ExportAllSeries();
  43. });
  44. }
  45. }
  46. }