Update MapHeadingToVisibilityConverter.cs

This commit is contained in:
ClemensFischer 2025-09-16 17:33:29 +02:00
parent 6f97900733
commit ef127dd61d

View file

@ -19,26 +19,27 @@ namespace SampleApplication
{ {
public object Convert(object value, Type targetType, object parameter, string language) public object Convert(object value, Type targetType, object parameter, string language)
{ {
var visible = (double)value != 0d;
#if AVALONIA #if AVALONIA
return (double)value != 0d; return visible;
#else #else
return (double)value != 0d ? Visibility.Visible : Visibility.Collapsed; return visible ? Visibility.Visible : Visibility.Collapsed;
#endif #endif
} }
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
public object Convert(object value, Type targetType, object parameter, CultureInfo culture) public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
{ {
return Convert(value, targetType, parameter, culture.ToString()); return Convert(value, targetType, parameter, culture.ToString());
} }
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
{ {
return ConvertBack(value, targetType, parameter, culture.ToString()); throw new NotImplementedException();
} }
} }
} }