using System; using System.Globalization; using Xamarin.Forms; using Xamarin.Forms.Xaml; namespace MMEA.Converters { /// <summary> /// Converter to inverse the boolean value for views /// </summary> public class InverseBoolConverter : IValueConverter, IMarkupExtension { /// <inheritdoc /> public object ProvideValue(IServiceProvider serviceProvider) { return this; } /// <inheritdoc /> public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { return !(bool) value; } /// <inheritdoc /> public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { return !(bool) value; } } }