using System.Globalization;
using System.Windows.Data;

namespace NexusShell.Converters;

public sealed class DockActiveConverter : IMultiValueConverter
{
    public object Convert(object[] values, Type targetType, object parameter, CultureInfo culture)
    {
        if (values.Length < 2)
        {
            return false;
        }

        var label = values[0]?.ToString() ?? string.Empty;
        var active = values[1]?.ToString() ?? string.Empty;
        return string.Equals(label, active, StringComparison.Ordinal);
    }

    public object[] ConvertBack(object value, Type[] targetTypes, object parameter, CultureInfo culture) =>
        throw new NotSupportedException();
}
