PanEnableConverter.cs 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Data;
  6. using System.Windows.Media;
  7. using System.Windows;
  8. using DataAnalysisControl.Core;
  9. namespace Aitex.UI.Charting.Converter
  10. {
  11. public class PanEnableConverter : IMultiValueConverter
  12. {
  13. public object Convert(object[] values, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  14. {
  15. try
  16. {
  17. /*<Binding ElementName="zoomPanModifier" Path="IsEnabled" />
  18. <Binding ElementName="sciChart" Path="XAxis.AutoRange" />
  19. <Binding ElementName="sciChart" Path="YAxis.AutoRange" />
  20. <Binding ElementName="rolloverModifier" Path="IsEnabled" />*/
  21. var isZoomPanModifierEnable = (bool)values[0];
  22. var isXAutoRangeEnable = (bool)values[1];
  23. var isYAutoRangeEnable = (bool)values[2];
  24. var isRolloverModifierEnable = (bool)values[3];
  25. return isZoomPanModifierEnable && !isXAutoRangeEnable && !isYAutoRangeEnable && !isRolloverModifierEnable;
  26. }
  27. catch (Exception ex)
  28. {
  29. CONTEXT.WriteLog(ex);
  30. }
  31. return false;
  32. }
  33. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, System.Globalization.CultureInfo culture)
  34. {
  35. return null;
  36. }
  37. }
  38. }