using Microsoft.UI.Xaml.Data;
namespace XFEExtension.NetCore.WinUIHelper.Utilities.Converter;
///
/// Provides conversion logic to determine whether an object is null.
///
/// This converter is typically used in data binding scenarios to convert an object to a boolean value.
/// The method returns if the input object is ;
/// otherwise, it returns . The method returns the input value
/// unchanged.
public partial class ObjectNullConverter : IValueConverter
{
///
/// Converts the specified value to a boolean indicating whether the value is not null.
///
/// The value to be checked for null.
/// The target type of the conversion. This parameter is not used in this implementation.
/// An optional parameter for the conversion. This parameter is not used in this implementation.
/// The language information for the conversion. This parameter is not used in this implementation.
/// if is not null; otherwise, .
public object Convert(object value, Type targetType, object parameter, string language) => value is null ? false : true;
///
/// Converts a value back to its original type or representation.
///
/// The value to be converted back. This is typically the result of a previous conversion.
/// The type to which the value should be converted. This parameter is not used in the default implementation.
/// An optional parameter to influence the conversion logic. This parameter is not used in the default
/// implementation.
/// The language or culture information to use during the conversion. This parameter is not used in the default
/// implementation.
/// The original value passed to the method, without modification.
public object ConvertBack(object value, Type targetType, object parameter, string language) => value;
}