From 49fdf80b7bfc7b1d7e518704f5c0296ea9ba5a99 Mon Sep 17 00:00:00 2001 From: rabbitism Date: Sun, 11 Feb 2024 23:52:23 +0800 Subject: [PATCH] feat: try to use grid as panel. --- demo/Ursa.Demo/Models/MenuKeys.cs | 1 + demo/Ursa.Demo/Pages/NavMenuDemo.axaml | 25 +++++++++++++++++++ demo/Ursa.Demo/Pages/NavMenuDemo.axaml.cs | 13 ++++++++++ demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml | 17 ------------- .../Ursa.Demo/ViewModels/MainViewViewModel.cs | 1 + demo/Ursa.Demo/ViewModels/MenuViewModel.cs | 1 + .../ViewModels/NavMenuDemoViewModel.cs | 8 ++++++ src/Ursa.Themes.Semi/Controls/NavMenu.axaml | 3 ++- 8 files changed, 51 insertions(+), 18 deletions(-) create mode 100644 demo/Ursa.Demo/Pages/NavMenuDemo.axaml create mode 100644 demo/Ursa.Demo/Pages/NavMenuDemo.axaml.cs create mode 100644 demo/Ursa.Demo/ViewModels/NavMenuDemoViewModel.cs diff --git a/demo/Ursa.Demo/Models/MenuKeys.cs b/demo/Ursa.Demo/Models/MenuKeys.cs index ea8f8f5..56e6a49 100644 --- a/demo/Ursa.Demo/Models/MenuKeys.cs +++ b/demo/Ursa.Demo/Models/MenuKeys.cs @@ -19,6 +19,7 @@ public static class MenuKeys public const string MenuKeyLoading = "Loading"; public const string MenuKeyMessageBox = "MessageBox"; public const string MenuKeyNavigation = "Navigation"; + public const string MenuKeyNavMenu = "NavMenu"; public const string MenuKeyNumericUpDown = "NumericUpDown"; public const string MenuKeyPagination = "Pagination"; public const string MenuKeyRangeSlider = "RangeSlider"; diff --git a/demo/Ursa.Demo/Pages/NavMenuDemo.axaml b/demo/Ursa.Demo/Pages/NavMenuDemo.axaml new file mode 100644 index 0000000..b9d58c6 --- /dev/null +++ b/demo/Ursa.Demo/Pages/NavMenuDemo.axaml @@ -0,0 +1,25 @@ + + + + + + + + + + + + + + + + + + + diff --git a/demo/Ursa.Demo/Pages/NavMenuDemo.axaml.cs b/demo/Ursa.Demo/Pages/NavMenuDemo.axaml.cs new file mode 100644 index 0000000..30898d6 --- /dev/null +++ b/demo/Ursa.Demo/Pages/NavMenuDemo.axaml.cs @@ -0,0 +1,13 @@ +using Avalonia; +using Avalonia.Controls; +using Avalonia.Markup.Xaml; + +namespace Ursa.Demo.Pages; + +public partial class NavMenuDemo : UserControl +{ + public NavMenuDemo() + { + InitializeComponent(); + } +} \ No newline at end of file diff --git a/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml b/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml index 23b4f44..18068cf 100644 --- a/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml +++ b/demo/Ursa.Demo/Pages/SelectionBoxDemo.axaml @@ -51,22 +51,5 @@ - - - - - - - - - - - - - - - - - diff --git a/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs b/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs index 0a20fe2..43166bd 100644 --- a/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs +++ b/demo/Ursa.Demo/ViewModels/MainViewViewModel.cs @@ -41,6 +41,7 @@ public class MainViewViewModel : ViewModelBase MenuKeys.MenuKeyLoading => new LoadingDemoViewModel(), MenuKeys.MenuKeyMessageBox => new MessageBoxDemoViewModel(), MenuKeys.MenuKeyNavigation => new NavigationMenuDemoViewModel(), + MenuKeys.MenuKeyNavMenu => new NavMenuDemoViewModel(), MenuKeys.MenuKeyNumericUpDown => new NumericUpDownDemoViewModel(), MenuKeys.MenuKeyPagination => new PaginationDemoViewModel(), MenuKeys.MenuKeyRangeSlider => new RangeSliderDemoViewModel(), diff --git a/demo/Ursa.Demo/ViewModels/MenuViewModel.cs b/demo/Ursa.Demo/ViewModels/MenuViewModel.cs index 1377af9..6f6da25 100644 --- a/demo/Ursa.Demo/ViewModels/MenuViewModel.cs +++ b/demo/Ursa.Demo/ViewModels/MenuViewModel.cs @@ -28,6 +28,7 @@ public class MenuViewModel: ViewModelBase new() { MenuHeader = "Loading", Key = MenuKeys.MenuKeyLoading }, new() { MenuHeader = "Message Box", Key = MenuKeys.MenuKeyMessageBox, Status = "New" }, new() { MenuHeader = "Navigation", Key = MenuKeys.MenuKeyNavigation, Status = "WIP" }, + new() { MenuHeader = "Nav Menu", Key = MenuKeys.MenuKeyNavMenu, Status = "WIP"}, new() { MenuHeader = "NumericUpDown", Key = MenuKeys.MenuKeyNumericUpDown, Status = "New" }, new() { MenuHeader = "Pagination", Key = MenuKeys.MenuKeyPagination }, new() { MenuHeader = "RangeSlider", Key = MenuKeys.MenuKeyRangeSlider, Status = "New"}, diff --git a/demo/Ursa.Demo/ViewModels/NavMenuDemoViewModel.cs b/demo/Ursa.Demo/ViewModels/NavMenuDemoViewModel.cs new file mode 100644 index 0000000..c99730f --- /dev/null +++ b/demo/Ursa.Demo/ViewModels/NavMenuDemoViewModel.cs @@ -0,0 +1,8 @@ +using CommunityToolkit.Mvvm.ComponentModel; + +namespace Ursa.Demo.ViewModels; + +public class NavMenuDemoViewModel: ObservableObject +{ + +} \ No newline at end of file diff --git a/src/Ursa.Themes.Semi/Controls/NavMenu.axaml b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml index a381d61..a2adf6e 100644 --- a/src/Ursa.Themes.Semi/Controls/NavMenu.axaml +++ b/src/Ursa.Themes.Semi/Controls/NavMenu.axaml @@ -3,6 +3,7 @@ xmlns:u="https://irihi.tech/ursa"> + @@ -20,7 +21,7 @@ - +