123456789101112131415161718192021222324252627282930 |
- using System;
- using System.Windows.Data;
- using System.Windows.Media;
- namespace Venus_MainPages.Converters
- {
- public class IsOnlineToColorConverter:IValueConverter
- {
- public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- if (value == null) return new SolidColorBrush(Colors.DarkGray);
- var item = (bool)value;
- if (item == true)
- {
- return new SolidColorBrush((Color)ColorConverter.ConvertFromString("#E7F0FB"));
- //return new SolidColorBrush(Colors.Lime);
- }
- else
- {
- return new SolidColorBrush(Colors.DarkGray);
- }
- }
- public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
- {
- return null;
- }
- }
- }
|