using Avalonia.Data.Converters; using Avalonia.Media; using System; using System.Collections.Generic; using System.Globalization; using System.Linq; using System.Text; using System.Threading.Tasks; namespace demo_trade.UI.Converters { public class ItemEnableConverterByDate : IValueConverter { public object? Convert(object? value, Type targetType, object? parameter, CultureInfo culture) { DateOnly date = (DateOnly)value; return date >= DateOnly.FromDateTime(DateTime.Now); } public object? ConvertBack(object? value, Type targetType, object? parameter, CultureInfo culture) { throw new NotSupportedException(); } } }