DataSelectFrameViewModel.cs 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  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 Aitex.UI.Charting.Model;
  8. namespace Aitex.UI.Charting.ViewModel
  9. {
  10. public class DataSelectFrameViewModel : ChartingBaseViewModel
  11. {
  12. public DataSelectFrameViewModel()
  13. {
  14. CommonViewModel = CommonViewModel.Instance;
  15. DataSourceComboxItemSelectChangeCommand = new ChartingCommand((o) => true, (o) =>
  16. {
  17. string dataSourceName = (string)o;
  18. foreach (var item in CommonViewModel.DataSources)
  19. {
  20. if (item.Value.Title == dataSourceName)
  21. {
  22. CommonViewModel.CurrentSelectedDataSource = item.Value;
  23. }
  24. }
  25. });
  26. }
  27. public CommonViewModel CommonViewModel { get; private set; }
  28. public ICommand DataSourceComboxItemSelectChangeCommand { get; private set; }
  29. }
  30. }