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; } } }