
namespace HistoryView.Converters;

public class ActiveTuneSetToVis : IValueConverter
{
    public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
    {
        if (value is not ActiveTuneSet tuneSet)
            return Visibility.Visible;

        if (parameter is not string para)
            return Visibility.Visible;

        //return string.Equals(tuneSet, para) switch
        //{
        //    true => Visibility.Visible,
        //    false => Visibility.Collapsed
        //};

        switch (tuneSet)
        {
            case ActiveTuneSet.AutoTune:
                return para switch
                {
                    "AutoTune" => Visibility.Visible,
                    _ => Visibility.Collapsed
                };

            case ActiveTuneSet.Running:
                return para switch
                {
                    "Running" => Visibility.Visible,
                    _ => Visibility.Collapsed
                };
            default:
                return Visibility.Visible;

        }
    }

    public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
    {
        throw new NotImplementedException();
    }
}
