From 18207ac477a94c3808b2eda170c83ed0b3e54653 Mon Sep 17 00:00:00 2001 From: Oleksandr Liakhevych Date: Mon, 11 Nov 2024 00:27:16 +0200 Subject: [PATCH] Support Window control --- samples/ControlGallery/AppShell.razor | 133 ++++---- .../Views/Menus/ContextMenuPage.razor | 2 +- .../ControlGallery/Views/WindowExample.razor | 7 + .../ControlGallery/Views/WindowsPage.razor | 14 + .../BlazorBindingsApplication.cs | 21 +- .../Handlers/ApplicationWindowHandler.cs | 51 ++++ .../Elements/Handlers/WindowHandler.cs | 25 -- .../Elements/Window.generated.cs | 289 ++++++++++++++++++ .../MauiBlazorBindingsRenderer.cs | 18 -- .../Navigation/INavigation.cs | 2 +- .../Navigation/Navigation.cs | 11 +- .../Properties/AttributeInfo.cs | 2 + .../BlazorBindingsApplicationTests.cs | 32 ++ .../Components/WindowWithPageContent.razor | 17 ++ .../MauiBlazorBindingsRendererTests.cs | 55 ---- 15 files changed, 507 insertions(+), 172 deletions(-) create mode 100644 samples/ControlGallery/Views/WindowExample.razor create mode 100644 samples/ControlGallery/Views/WindowsPage.razor create mode 100644 src/BlazorBindings.Maui/Elements/Handlers/ApplicationWindowHandler.cs delete mode 100644 src/BlazorBindings.Maui/Elements/Handlers/WindowHandler.cs create mode 100644 src/BlazorBindings.Maui/Elements/Window.generated.cs create mode 100644 src/BlazorBindings.UnitTests/Components/WindowWithPageContent.razor delete mode 100644 src/BlazorBindings.UnitTests/MauiBlazorBindingsRendererTests.cs diff --git a/samples/ControlGallery/AppShell.razor b/samples/ControlGallery/AppShell.razor index 208aa846..1b8771db 100644 --- a/samples/ControlGallery/AppShell.razor +++ b/samples/ControlGallery/AppShell.razor @@ -13,82 +13,85 @@ @using ControlGallery.Views.Shell @using ControlGallery.Views.Menus - + + - @*Present data*@ - - - + @*Present data*@ + + + - @*Initiate commands*@ - - - - + @*Initiate commands*@ + + + + - @*Set values*@ - - - - - - + @*Set values*@ + + + + + + - @*Edit text*@ - - + @*Edit text*@ + + - @*Display collections*@ - - - - - - - - - - - + @*Display collections*@ + + + + + + + + + + + - @*Layouts*@ - - - + @*Layouts*@ + + + - @*Shell*@ - - - - - + @*Shell*@ + + + + + - + - @*Navigation*@ - - - - + @*Navigation*@ + + + + - @*Other*@ - - - - + @*Other*@ + + + + - @if (DeviceInfo.Platform == DevicePlatform.WinUI || DeviceInfo.Platform == DevicePlatform.MacCatalyst) - { - - - } - + @if (DeviceInfo.Platform == DevicePlatform.WinUI || DeviceInfo.Platform == DevicePlatform.MacCatalyst) + { + + + + } + + @code { Color _backgroundColor; diff --git a/samples/ControlGallery/Views/Menus/ContextMenuPage.razor b/samples/ControlGallery/Views/Menus/ContextMenuPage.razor index 91deecde..fce80df2 100644 --- a/samples/ControlGallery/Views/Menus/ContextMenuPage.razor +++ b/samples/ControlGallery/Views/Menus/ContextMenuPage.razor @@ -24,7 +24,7 @@ @code { - Color? _selectedColor = null; + Color _selectedColor = null; void SelectColor(Color color) => _selectedColor = color; } diff --git a/samples/ControlGallery/Views/WindowExample.razor b/samples/ControlGallery/Views/WindowExample.razor new file mode 100644 index 00000000..d16c898f --- /dev/null +++ b/samples/ControlGallery/Views/WindowExample.razor @@ -0,0 +1,7 @@ + + + + + + + \ No newline at end of file diff --git a/samples/ControlGallery/Views/WindowsPage.razor b/samples/ControlGallery/Views/WindowsPage.razor new file mode 100644 index 00000000..c6a4141f --- /dev/null +++ b/samples/ControlGallery/Views/WindowsPage.razor @@ -0,0 +1,14 @@ + + +