UseCountBGColorConverter.cs 1003 B

12345678910111213141516171819202122232425262728293031323334353637383940
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Globalization;
  5. using System.Linq;
  6. using System.Text;
  7. using System.Threading.Tasks;
  8. using System.Windows.Data;
  9. namespace FurnaceUI.Converter
  10. {
  11. public class UseCountBGColorConverter:IValueConverter
  12. {
  13. public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  14. {
  15. bool itype = (bool)value;
  16. Brush bs=Brushes.White;
  17. if (value == null)
  18. {
  19. bs = null;
  20. }
  21. if (itype)
  22. {
  23. bs= Brushes.Red; ;
  24. }
  25. if (!itype)
  26. {
  27. bs=Brushes.Yellow;
  28. }
  29. return bs;
  30. }
  31. public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  32. {
  33. throw new NotImplementedException();
  34. }
  35. }
  36. }