using System; using System.Globalization; using Xamarin.Forms; namespace InABox.Mobile { public class BooleanToColorConverter: BindableObject, IValueConverter { public Color TrueColor { get; set; } public Color FalseColor { get; set; } public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool bValue) return bValue ? TrueColor : FalseColor; return FalseColor; } public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }