using Avalonia; using Avalonia.Collections; using Avalonia.Controls.Primitives; using Avalonia.Interactivity; namespace Ursa.Controls; public class Calendar: TemplatedControl { public static readonly StyledProperty SelectedDateProperty = AvaloniaProperty.Register(nameof(SelectedDate), DateTime.Now); public DateTime SelectedDate { get => GetValue(SelectedDateProperty); set => SetValue(SelectedDateProperty, value); } public static readonly StyledProperty FirstDayOfWeekProperty = AvaloniaProperty.Register(nameof(FirstDayOfWeek), defaultValue: DateTimeHelper.GetCurrentDateTimeFormatInfo().FirstDayOfWeek); public DayOfWeek FirstDayOfWeek { get => GetValue(FirstDayOfWeekProperty); set => SetValue(FirstDayOfWeekProperty, value); } public static readonly StyledProperty IsTodayHighlightedProperty = AvaloniaProperty.Register(nameof(IsTodayHighlighted), true); public bool IsTodayHighlighted { get => GetValue(IsTodayHighlightedProperty); set => SetValue(IsTodayHighlightedProperty, value); } public static readonly StyledProperty?> DisabledDatesProperty = AvaloniaProperty.Register?>( nameof(DisabledDates)); public AvaloniaList? DisabledDates { get => GetValue(DisabledDatesProperty); set => SetValue(DisabledDatesProperty, value); } public static readonly StyledProperty DisabledDateRuleProperty = AvaloniaProperty.Register( nameof(DisabledDateRule)); public IDateSelector? DisabledDateRule { get => GetValue(DisabledDateRuleProperty); set => SetValue(DisabledDateRuleProperty, value); } }