using System.Globalization;
using Avalonia.Data.Converters;

namespace ABStemPlayer.Converters;

public sealed class BoolInvertConverter : IValueConverter
{
    public static BoolInvertConverter Instance { get; } = new();

    public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture)
        => value is bool b ? !b : value;

    public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture)
        => value is bool b ? !b : value;
}
