Hi everybody, i have a converter that isn't working. Here is the code : `
public class ConverterNotBoolean : IValueConverter
{
public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null || value.GetType() != typeof(bool)) { return value; }
return !(bool)value;
}
public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)
{
if (value == null || value.GetType() != typeof(bool)) { return value; }
return !(bool)value;
}
}`
And in my xaml : `
<ContentPage.Resources>
</ContentPage.Resources>
`
I need this converter to show or hide controls. In my case, my button must be shown if the property binded is set to False (instead of True).
But i'm not even hitting the breackpoint set at the first line in my converter.
Right now, i'm using a workaround (a read only property that return not my other property). Are converters usefull in xamarin ? Becauce we can create a prperty that convert the value for us and act as a proxy.