From 98ec1d696ad50439150d8bd98dbaaa47cd65bfa4 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Fri, 3 May 2024 23:58:54 +0800 Subject: [PATCH] feat: add new control. --- src/Ursa/Controls/DateTimePicker/Calendar.cs | 29 ++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 src/Ursa/Controls/DateTimePicker/Calendar.cs diff --git a/src/Ursa/Controls/DateTimePicker/Calendar.cs b/src/Ursa/Controls/DateTimePicker/Calendar.cs new file mode 100644 index 0000000..5b2e1f6 --- /dev/null +++ b/src/Ursa/Controls/DateTimePicker/Calendar.cs @@ -0,0 +1,29 @@ +using Avalonia; +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), DayOfWeek.Sunday); + 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); + } +} \ No newline at end of file