using System; using System.Diagnostics.Contracts; using System.Globalization; using System.Runtime.CompilerServices; using System.Windows; using System.Windows.Data; namespace OwlCore.Wpf.Converters.Bools.Visible { /// /// A converter that converts a the inverse of a given a . /// public sealed class InverseBoolToVisibilityConverter : IValueConverter { /// /// Gets a based on the opposite of a bool. /// /// The bool to represented. /// if , if [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Visibility Convert(bool data) => BoolToVisibilityConverter.Convert(!data); /// public object Convert(object value, Type targetType, object parameter, CultureInfo culture) { if (value is bool bValue) { return Convert(bValue); } return Visibility.Visible; } /// public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture) { throw new NotImplementedException(); } } }