diff --git a/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs b/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs index 62d4bf7..d972398 100644 --- a/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs +++ b/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs @@ -1,11 +1,71 @@ -using Avalonia.Controls; +using AtomUI.Controls; +using Avalonia; +using Avalonia.Controls; namespace AtomUI.Demo.Desktop.ShowCase; public partial class DatePickerShowCase : UserControl { + public static readonly StyledProperty PickerSizeTypeProperty = + AvaloniaProperty.Register(nameof(PickerSizeType), SizeType.Middle); + + public static readonly StyledProperty PickerPlacementProperty = + AvaloniaProperty.Register(nameof(PickerPlacement), PlacementMode.BottomEdgeAlignedLeft); + + public SizeType PickerSizeType + { + get => GetValue(PickerSizeTypeProperty); + set => SetValue(PickerSizeTypeProperty, value); + } + + public PlacementMode PickerPlacement + { + get => GetValue(PickerPlacementProperty); + set => SetValue(PickerPlacementProperty, value); + } + public DatePickerShowCase() { InitializeComponent(); + DataContext = this; + + PickerSizeTypeOptionGroup.OptionCheckedChanged += HandlePickerSizeTypeOptionCheckedChanged; + PickerPlacementOptionGroup.OptionCheckedChanged += HandlePickerPlacementCheckedChanged; + } + + private void HandlePickerSizeTypeOptionCheckedChanged(object? sender, OptionCheckedChangedEventArgs args) + { + if (args.Index == 0) + { + PickerSizeType = SizeType.Large; + } + else if (args.Index == 1) + { + PickerSizeType = SizeType.Middle; + } + else + { + PickerSizeType = SizeType.Small; + } + } + + private void HandlePickerPlacementCheckedChanged(object? sender, OptionCheckedChangedEventArgs args) + { + if (args.Index == 0) + { + PickerPlacement = PlacementMode.TopEdgeAlignedLeft; + } + else if (args.Index == 1) + { + PickerPlacement = PlacementMode.TopEdgeAlignedRight; + } + else if (args.Index == 2) + { + PickerPlacement = PlacementMode.BottomEdgeAlignedLeft; + } + else + { + PickerPlacement = PlacementMode.BottomEdgeAlignedRight; + } } } \ No newline at end of file diff --git a/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs.axaml b/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs.axaml index 13ac732..b8f9d61 100644 --- a/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs.axaml +++ b/samples/AtomUI.Demo.Desktop/ShowCase/DatePickerShowCase.cs.axaml @@ -6,49 +6,184 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:desktop="clr-namespace:AtomUI.Demo.Desktop" xmlns:atom="https://atomui.net" - xmlns:calendarView="clr-namespace:AtomUI.Controls.CalendarView;assembly=AtomUI.Controls" mc:Ignorable="d"> - - - - - - - - - - - - - - - - - + + + - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + Title="Three Sizes" + Description="The input box comes in three sizes: small, middle and large. The middle size will be used if size is omitted."> + + + + Expand direction: + + Large + Default + Small + + + + + + + + - + Title="Status" + Description="Add status to DatePicker with status, which could be error or warning."> + + + + + + + + + + + + + + - - - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + Expand direction: + + TopLeft + TopRight + BottomLeft + BottomRight + + + + + + + + + + \ No newline at end of file diff --git a/src/AtomUI.Controls/DatePicker/RangeDatePickerTheme.cs b/src/AtomUI.Controls/DatePicker/RangeDatePickerTheme.cs index 86325fb..c836c05 100644 --- a/src/AtomUI.Controls/DatePicker/RangeDatePickerTheme.cs +++ b/src/AtomUI.Controls/DatePicker/RangeDatePickerTheme.cs @@ -16,7 +16,7 @@ internal class RangeDatePickerTheme : RangeInfoPickerInputTheme { return new PathIcon() { - Kind = "ClockCircleOutlined" + Kind = "CalendarOutlined" }; }