using System;
using System.Windows;

namespace InABox.WPF;

public class StringToVisibilityConverter : AbstractConverter<string,Visibility>
{
    public bool HideIfEmpty { get; set; } = true;
    
    public override Visibility Convert(String value)
    {
        return string.IsNullOrWhiteSpace(value)
            ? HideIfEmpty
                ? Visibility.Collapsed
                : Visibility.Visible
            : HideIfEmpty
                ? Visibility.Visible
                : Visibility.Collapsed;
    }
}