Vereinsmeisterschaften  22aa7800eae54b428d40e835886cefe1fdefdfdf
This is a software that can be used to manage the internal competition of the swimming club Illertissen called "Vereinsmeisterschaften".
Loading...
Searching...
No Matches
PersonCompetitionStatusToBrushConverter.cs
1using System.Drawing;
2using System.Globalization;
3using System.Windows.Data;
4using System.Windows.Media;
5
7
13[ValueConversion(typeof(bool), typeof(SolidColorBrush))]
14public class PersonCompetitionStatusToBrushConverter : IMultiValueConverter
15{
19 public SolidColorBrush BrushCompetitionMissingAndSelected { get; set; } = new SolidColorBrush(Colors.Red);
20
24 public SolidColorBrush BrushCompetitionMissing { get; set; } = new SolidColorBrush(Colors.Gray);
25
29 public SolidColorBrush BrushCompetitionAvailable { get; set; } = new SolidColorBrush(Colors.Transparent);
30
39 public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
40 {
41 if (values.Length < 2 || !(values[0] is bool isCompetitionAvailable) || !(values[1] is bool isCompetitionSelected))
43
44 if (!isCompetitionAvailable && isCompetitionSelected)
46 if (!isCompetitionAvailable && !isCompetitionSelected)
48
50 }
51
61 public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture)
62 {
63 throw new NotImplementedException();
64 }
65}
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.