WaferDropConverter.cs 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. using Aitex.Core.Common;
  2. using System;
  3. using System.Globalization;
  4. using System.Windows;
  5. using System.Windows.Data;
  6. namespace Aitex.Sorter.UI.Converter
  7. {
  8. public class WaferDropConverter : IMultiValueConverter
  9. {
  10. public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
  11. {
  12. if (values[0] != null && values[0] != DependencyProperty.UnsetValue)
  13. {
  14. var status = (WaferStatus)values[0];
  15. var isDestination = (bool)values[1];
  16. return (status == WaferStatus.Empty || status == WaferStatus.Dummy) && !isDestination;
  17. }
  18. return false;
  19. }
  20. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
  21. {
  22. throw new NotImplementedException();
  23. }
  24. }
  25. public class WaferDropConverter2 : IMultiValueConverter
  26. {
  27. public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
  28. {
  29. if (values[0] != null && values[0] != DependencyProperty.UnsetValue)
  30. {
  31. var status = (WaferStatus)values[0];
  32. var isDestination = (bool)values[1];
  33. var isShowControl= (bool)values[2];
  34. if (!isShowControl)
  35. {
  36. return false;
  37. }
  38. return (status == WaferStatus.Empty || status == WaferStatus.Dummy) && !isDestination;
  39. }
  40. return false;
  41. }
  42. public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
  43. {
  44. throw new NotImplementedException();
  45. }
  46. }
  47. }