WaferStatusConverter.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  1. using Aitex.Core.Common;
  2. using System;
  3. using System.Collections.Generic;
  4. using System.Globalization;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows.Data;
  9. using System.Windows.Media;
  10. namespace EfemDualUI.Converter
  11. {
  12. public class WaferStatusConverter : IValueConverter
  13. {
  14. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  15. {
  16. if (value == null)
  17. {
  18. return null;
  19. }
  20. var status = (WaferStatus)value;
  21. switch (status)
  22. {
  23. case WaferStatus.Empty:
  24. return null;
  25. case WaferStatus.Normal:
  26. return Brushes.Green;
  27. case WaferStatus.Crossed:
  28. return Brushes.Orange;
  29. case WaferStatus.Double:
  30. return Brushes.OrangeRed;
  31. case WaferStatus.Unknown:
  32. return Brushes.Red;
  33. case WaferStatus.Dummy:
  34. return Brushes.Green;
  35. default:
  36. break;
  37. }
  38. return null;
  39. }
  40. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  41. {
  42. throw new NotImplementedException();
  43. }
  44. }
  45. }