RFIsOnToColorConverter.cs 1.0 KB

12345678910111213141516171819202122232425262728293031323334
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Drawing;
  4. using System.Linq;
  5. using System.Text;
  6. using System.Windows.Data;
  7. using System.Windows.Media;
  8. namespace Aitex.Triton160.UI.Converter
  9. {
  10. public class RFIsOnToColorConverter : IValueConverter
  11. {
  12. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  13. {
  14. if (value == null) new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#669ACC"));
  15. if ((bool)(value) == true)
  16. {
  17. return new SolidColorBrush(Colors.HotPink);
  18. }
  19. else
  20. {
  21. return new SolidColorBrush((System.Windows.Media.Color)System.Windows.Media.ColorConverter.ConvertFromString("#669ACC"));
  22. }
  23. }
  24. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  25. {
  26. throw new NotImplementedException();
  27. }
  28. }
  29. }