IsOnlineToColorConverter.cs 851 B

1234567891011121314151617181920212223242526272829
  1. using System;
  2. using System.Windows.Data;
  3. using System.Windows.Media;
  4. namespace Venus_MainPages.Converters
  5. {
  6. public class IsOnlineToColorConverter:IValueConverter
  7. {
  8. public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  9. {
  10. var item = (bool)value;
  11. if (item == true)
  12. {
  13. return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#E7F0FB"));
  14. //return new SolidColorBrush(Colors.Lime);
  15. }
  16. else
  17. {
  18. return new SolidColorBrush(Colors.DarkGray);
  19. }
  20. }
  21. public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
  22. {
  23. return null;
  24. }
  25. }
  26. }