using Avalonia; using Avalonia.Collections; using Avalonia.Controls.Primitives; using Avalonia.Data; using Irihi.Avalonia.Shared.Contracts; namespace Ursa.Controls; public class DatePickerBase : TemplatedControl, IInnerContentControl, IPopupInnerContent { public static readonly StyledProperty DisplayFormatProperty = AvaloniaProperty.Register( nameof(DisplayFormat), "yyyy-MM-dd"); public static readonly StyledProperty> BlackoutDatesProperty = AvaloniaProperty.Register>(nameof(BlackoutDates)); public static readonly StyledProperty BlackoutDateRuleProperty = AvaloniaProperty.Register(nameof(BlackoutDateRule)); public static readonly StyledProperty FirstDayOfWeekProperty = AvaloniaProperty.Register( nameof(FirstDayOfWeek), DateTimeHelper.GetCurrentDateTimeFormatInfo().FirstDayOfWeek); public static readonly StyledProperty IsTodayHighlightedProperty = AvaloniaProperty.Register(nameof(IsTodayHighlighted), true); public static readonly StyledProperty InnerLeftContentProperty = AvaloniaProperty.Register( nameof(InnerLeftContent)); public static readonly StyledProperty InnerRightContentProperty = AvaloniaProperty.Register( nameof(InnerRightContent)); public static readonly StyledProperty PopupInnerTopContentProperty = AvaloniaProperty.Register( nameof(PopupInnerTopContent)); public static readonly StyledProperty PopupInnerBottomContentProperty = AvaloniaProperty.Register( nameof(PopupInnerBottomContent)); public static readonly StyledProperty IsDropdownOpenProperty = AvaloniaProperty.Register( nameof(IsDropdownOpen), defaultBindingMode: BindingMode.TwoWay); public static readonly StyledProperty IsReadonlyProperty = AvaloniaProperty.Register( nameof(IsReadonly)); public AvaloniaList BlackoutDates { get => GetValue(BlackoutDatesProperty); set => SetValue(BlackoutDatesProperty, value); } public IDateSelector? BlackoutDateRule { get => GetValue(BlackoutDateRuleProperty); set => SetValue(BlackoutDateRuleProperty, value); } public DayOfWeek FirstDayOfWeek { get => GetValue(FirstDayOfWeekProperty); set => SetValue(FirstDayOfWeekProperty, value); } public bool IsTodayHighlighted { get => GetValue(IsTodayHighlightedProperty); set => SetValue(IsTodayHighlightedProperty, value); } public bool IsReadonly { get => GetValue(IsReadonlyProperty); set => SetValue(IsReadonlyProperty, value); } public bool IsDropdownOpen { get => GetValue(IsDropdownOpenProperty); set => SetValue(IsDropdownOpenProperty, value); } public object? InnerLeftContent { get => GetValue(InnerLeftContentProperty); set => SetValue(InnerLeftContentProperty, value); } public object? InnerRightContent { get => GetValue(InnerRightContentProperty); set => SetValue(InnerRightContentProperty, value); } public object? PopupInnerTopContent { get => GetValue(PopupInnerTopContentProperty); set => SetValue(PopupInnerTopContentProperty, value); } public object? PopupInnerBottomContent { get => GetValue(PopupInnerBottomContentProperty); set => SetValue(PopupInnerBottomContentProperty, value); } public string? DisplayFormat { get => GetValue(DisplayFormatProperty); set => SetValue(DisplayFormatProperty, value); } }