using System;
using System.Diagnostics.Contracts;
using System.Runtime.CompilerServices;
using Windows.UI.Xaml;
using Windows.UI.Xaml.Data;
namespace OwlCore.WinUI.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, string language)
{
if (value is bool bValue)
{
return Convert(bValue);
}
return Visibility.Visible;
}
///
public object ConvertBack(object value, Type targetType, object parameter, string language)
{
throw new NotImplementedException();
}
}
}