
using CommunityToolkit.Mvvm.ComponentModel;

namespace InABox.Avalonia.Converters;

public partial class ObjectToBooleanConverter : AbstractConverter<object,bool>
{
    [ObservableProperty] 
    private bool _inverted;

    protected override bool Convert(object? value, object? parameter = null)
    {
        var empty = value is null;
        return Inverted 
            ? empty 
            : !empty;
    }

    public ObjectToBooleanConverter()
    {
        Inverted = false;
    }
    
}