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
PersonStartToCompetitionIDStringConverter.cs
1using System.Globalization;
2using System.Windows.Data;
5
7
11[ValueConversion(typeof(Person), typeof(string))]
12public class PersonStartToCompetitionIDStringConverter : IValueConverter
13{
22 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
23 {
24 if(value != null && value is Person personVal && parameter is SwimmingStyles swimmingStyle)
25 {
26 int competitionID = personVal.AvailableCompetitionsIDs[swimmingStyle];
27 return competitionID == -1 ? Resources.CompetitionMissingString : ($"{Resources.CompetitionIDString} : {competitionID}");
28 }
29 return null;
30 }
31
41 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
42 {
43 throw new NotImplementedException();
44 }
45}
Converts the requested competition of a Person to a competition ID string representation.
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Conversion method.
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Back conversion method.
Class describing a person.
Definition Person.cs:12
static string CompetitionMissingString
Sucht eine lokalisierte Zeichenfolge, die Competition is missing ähnelt.
SwimmingStyles
Available swimming styles.