using System;
using System.Globalization;
using System.Windows;
using InABox.Core;

namespace InABox.WPF;

public class DateTimeToVisibilityConverter : AbstractConverter<DateTime,Visibility>
{
    public bool HideIfEmpty { get; set; } = true;
    
    public override Visibility Convert(DateTime value)
    {
        return value.IsEmpty()
            ? HideIfEmpty
                ? Visibility.Collapsed
                : Visibility.Visible
            : HideIfEmpty
                ? Visibility.Visible
                : Visibility.Collapsed;
    }
}