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
BooleanToStringConverter.cs
1using System.Globalization;
2using System.Windows.Data;
3
5
11[ValueConversion(typeof(bool), typeof(string))]
12public class BooleanToStringConverter : IValueConverter
13{
17 public string TrueString { get; set; } = "True";
18
22 public string FalseString { get; set; } = "False";
23
32 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
33 {
34 if(value != null && value is bool boolVal)
35 {
36 return boolVal ? TrueString : FalseString;
37 }
38 return null;
39 }
40
50 public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
51 {
52 throw new NotImplementedException();
53 }
54}
Converts a boolean value to a string representation.
object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
Back conversion method.
string TrueString
String to return when the boolean value is true.
object Convert(object value, Type targetType, object parameter, CultureInfo culture)
Conversion method.
string FalseString
String to return when the boolean value is false.