BooleanToColorConverter.cs 1.1 KB

1234567891011121314151617181920212223242526272829303132333435
  1. using System;
  2. using System.Globalization;
  3. using Xamarin.Forms;
  4. namespace comal.timesheets
  5. {
  6. // public class BooleanToColorConverter: BindableObject, IValueConverter
  7. // {
  8. //
  9. // public static readonly BindableProperty DefaultColorProperty =
  10. // BindableProperty.Create(nameof(DefaultColor), typeof(Color), typeof(BooleanToColorConverter), Color.Transparent);
  11. //
  12. // public Color DefaultColor
  13. // {
  14. // get => (Color)GetValue(DefaultColorProperty);
  15. // set => SetValue(DefaultColorProperty, value);
  16. // }
  17. //
  18. // public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
  19. // {
  20. // if ((value is bool bValue) && (parameter is Binding bColor))
  21. // {
  22. // bColor.
  23. // }
  24. // return bValue ? cColor : DefaultColor;
  25. // return DefaultColor;
  26. // }
  27. //
  28. // public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
  29. // {
  30. // throw new NotImplementedException();
  31. // }
  32. // }
  33. }