using Avalonia.Media;

namespace InABox.Avalonia.Converters;

public class DateTimeToColorConverter : AbstractConverter<DateTime,IBrush?>
{

    public DateTime? Threshold { get; set; } = null;    
    
    public IBrush? Expired{ get; set; }
        
    public IBrush? Current { get; set; }
        
    protected override IBrush? Convert(DateTime value, object? parameter = null)
    {
        var threshold = Threshold ?? DateTime.Now;
        return value < threshold ? Expired : Current;
    }

}