2using System.Globalization;
3using System.Windows.Data;
4using System.Windows.Media;
13[ValueConversion(typeof(
bool), typeof(SolidColorBrush))]
39 public object Convert(
object[] values, Type targetType,
object parameter, CultureInfo culture)
41 if (values.Length < 2 || !(values[0] is
bool isCompetitionAvailable) || !(values[1] is
bool isCompetitionSelected))
44 if (!isCompetitionAvailable && isCompetitionSelected)
46 if (!isCompetitionAvailable && !isCompetitionSelected)
61 public object[]
ConvertBack(
object value, Type[] targetTypes,
object parameter, CultureInfo culture)
63 throw new NotImplementedException();
Converter that converts the competition status of a person to a corresponding brush color.
object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
Conversion method.
SolidColorBrush BrushCompetitionMissingAndSelected
Brush used when the competition is missing and selected.
SolidColorBrush BrushCompetitionAvailable
Brush used when the competition is available.
object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
Back conversion method.
SolidColorBrush BrushCompetitionMissing
Brush used when the competition is missing but not selected.