diff --git a/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml b/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml index 18068cf..23b4f44 100644 --- a/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml +++ b/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml @@ -51,5 +51,22 @@ + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Controls/NavMenu.axaml b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml new file mode 100644 index 0000000..a381d61 --- /dev/null +++ b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/Ursa.Themes.Semi/Controls/_index.axaml b/src/Ursa.Themes.Semi/Controls/_index.axaml index 4bd0c67..0b2dae5 100644 --- a/src/Ursa.Themes.Semi/Controls/_index.axaml +++ b/src/Ursa.Themes.Semi/Controls/_index.axaml @@ -18,6 +18,7 @@ + diff --git a/src/Ursa/Controls/NavMenu/NavMenu.cs b/src/Ursa/Controls/NavMenu/NavMenu.cs new file mode 100644 index 0000000..1a06dc3 --- /dev/null +++ b/src/Ursa/Controls/NavMenu/NavMenu.cs @@ -0,0 +1,17 @@ +using Avalonia.Controls; +using Avalonia.Controls.Primitives; + +namespace Ursa.Controls; + +public class NavMenu: SelectingItemsControl +{ + protected override bool NeedsContainerOverride(object? item, int index, out object? recycleKey) + { + return NeedsContainer(item, out recycleKey); + } + + protected override Control CreateContainerForItemOverride(object? item, int index, object? recycleKey) + { + return new NavMenuItem(); + } +} \ No newline at end of file diff --git a/src/Ursa/Controls/NavMenu/NavMenuItem.cs b/src/Ursa/Controls/NavMenu/NavMenuItem.cs new file mode 100644 index 0000000..860e6f8 --- /dev/null +++ b/src/Ursa/Controls/NavMenu/NavMenuItem.cs @@ -0,0 +1,27 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Controls.Primitives; + +namespace Ursa.Controls; + +public class NavMenuItem: HeaderedSelectingItemsControl +{ + public static readonly StyledProperty IconProperty = AvaloniaProperty.Register( + nameof(Icon)); + + public object? Icon + { + get => GetValue(IconProperty); + set => SetValue(IconProperty, value); + } + + protected override bool NeedsContainerOverride(object? item, int index, out object? recycleKey) + { + return NeedsContainer(item, out recycleKey); + } + + protected override Control CreateContainerForItemOverride(object? item, int index, object? recycleKey) + { + return new NavMenuItem(); + } +} \ No newline at end of file