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 checks if an object is null and returns a . /// public sealed class NullToVisibilityConverter : IValueConverter { /// /// Checks if an object is null, and returns a . /// /// The object to null check. /// if not null, if null. [Pure] [MethodImpl(MethodImplOptions.AggressiveInlining)] public static Visibility Convert(object? obj) => BoolToVisibilityConverter.Convert(obj == null); /// public object Convert(object value, Type targetType, object parameter, string language) { return Convert(value); } /// public object ConvertBack(object value, Type targetType, object parameter, string language) { throw new NotImplementedException(); } } }