From 21b7b5e1dd1f12b8e539ce8b299345f79cdb10bd Mon Sep 17 00:00:00 2001 From: Alberto Aldegheri Date: Sun, 17 Mar 2024 17:10:44 +0100 Subject: [PATCH 1/3] Prepare for multi-library --- Directory.Build.props | 1 + Nalu.sln | 14 ++++ Samples/Directory.Build.props | 1 + Samples/Nalu.Maui.DefaultShellSample/App.xaml | 1 - .../Nalu.Maui.DefaultShellSample.csproj | 2 - Samples/Nalu.Maui.Sample/AppShell.xaml | 2 +- Samples/Nalu.Maui.Sample/AppShell.xaml.cs | 3 +- .../Nalu.Maui.Sample/Nalu.Maui.Sample.csproj | 2 - Samples/Nalu.Maui.Sample/Pages/TwoPage.xaml | 2 +- .../Internals/NaluElementHandlerExtensions.cs | 0 Source/Nalu.Maui.Core/Nalu.Maui.Core.csproj | 46 +++++++++++++ .../Platforms/Android/.gitkeep | 0 .../Platforms/MacCatalyst/.gitkeep | 0 .../Platforms/Windows/.gitkeep | 0 .../Platforms/iOS/.gitkeep | 0 .../NaluMauiAppBuilderExtensions.cs | 0 .../NaluMauiNavigationExtensions.cs | 0 .../nalu_navigation_arrow_back_android.svg | 0 .../Images/nalu_navigation_arrow_back_ios.svg | 0 .../Images/nalu_navigation_menu.svg | 0 .../Interfaces}/IAppearingAware.cs | 0 .../Interfaces}/IDisappearingAware.cs | 0 .../Interfaces}/IEnteringAware.cs | 0 .../Interfaces}/ILeavingAware.cs | 0 .../Interfaces}/ILeavingGuard.cs | 0 .../Interfaces}/INaluShell.cs | 0 .../Interfaces}/INavigationConfiguration.cs | 0 .../Interfaces}/INavigationService.cs | 0 .../Interfaces}/INavigationServiceProvider.cs | 0 .../INavigationServiceProviderInternal.cs | 0 .../Internals}/FixedRouteFactory.cs | 0 .../Internals}/LeakDetector.cs | 0 .../Internals}/NavigationHelper.cs | 0 .../Internals}/NavigationService.cs | 0 .../Internals}/NavigationServiceProvider.cs | 0 .../Internals}/NavigationStackPage.cs | 0 .../Internals}/PageNavigationContext.cs | 0 .../Nalu.Maui.Navigation.csproj | 64 +++++++++++++++++++ .../Nalu.Maui.Navigation.csproj.DotSettings | 6 ++ .../Nalu.Maui.Navigation.targets} | 0 .../Nalu.Maui.csproj.DotSettings | 0 .../NaluShell.cs | 0 .../NavigateCommand.cs | 0 .../NavigationBehavior.cs | 0 .../NavigationConfigurator.cs | 0 .../NavigationInfo/AbsoluteNavigation.cs | 0 .../NavigationInfo/INavigationInfo.cs | 0 .../NavigationInfo/INavigationSegment.cs | 0 .../NavigationInfo/Navigation.cs | 0 .../NavigationInfo/NavigationExtensions.cs | 0 .../NavigationInfo/NavigationPop.cs | 0 .../NavigationInfo/NavigationSegment.cs | 0 .../NavigationSegmentAttribute.cs | 0 .../NavigationInfo/RelativeNavigation.cs | 0 .../Platforms/Android/.gitkeep | 0 .../Platforms/MacCatalyst/.gitkeep | 0 .../Platforms/Windows/.gitkeep | 0 .../Platforms/iOS/.gitkeep | 0 .../ShellInfo/IShellContentProxy.cs | 0 .../ShellInfo/IShellItemProxy.cs | 0 .../ShellInfo/IShellProxy.cs | 0 .../ShellInfo/IShellSectionProxy.cs | 0 .../ShellInfo/ShellContentProxy.cs | 0 .../ShellInfo/ShellItemProxy.cs | 0 .../ShellInfo/ShellProxy.cs | 0 .../ShellInfo/ShellSectionProxy.cs | 0 Source/Nalu.Maui/Nalu.Maui.csproj | 37 +---------- .../Nalu.Maui/Navigation/NavigationLevel.cs | 19 ------ 68 files changed, 137 insertions(+), 63 deletions(-) rename Source/{Nalu.Maui/Extensions => Nalu.Maui.Core}/Internals/NaluElementHandlerExtensions.cs (100%) create mode 100644 Source/Nalu.Maui.Core/Nalu.Maui.Core.csproj rename Source/{Nalu.Maui => Nalu.Maui.Core}/Platforms/Android/.gitkeep (100%) rename Source/{Nalu.Maui => Nalu.Maui.Core}/Platforms/MacCatalyst/.gitkeep (100%) rename Source/{Nalu.Maui => Nalu.Maui.Core}/Platforms/Windows/.gitkeep (100%) rename Source/{Nalu.Maui => Nalu.Maui.Core}/Platforms/iOS/.gitkeep (100%) rename Source/{Nalu.Maui => Nalu.Maui.Navigation}/Extensions/NaluMauiAppBuilderExtensions.cs (100%) rename Source/{Nalu.Maui => Nalu.Maui.Navigation}/Extensions/NaluMauiNavigationExtensions.cs (100%) rename Source/{Nalu.Maui => Nalu.Maui.Navigation}/Images/nalu_navigation_arrow_back_android.svg (100%) rename Source/{Nalu.Maui => Nalu.Maui.Navigation}/Images/nalu_navigation_arrow_back_ios.svg (100%) rename Source/{Nalu.Maui => Nalu.Maui.Navigation}/Images/nalu_navigation_menu.svg (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/IAppearingAware.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/IDisappearingAware.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/IEnteringAware.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/ILeavingAware.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/ILeavingGuard.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/INaluShell.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/INavigationConfiguration.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/INavigationService.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/INavigationServiceProvider.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Interfaces}/INavigationServiceProviderInternal.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Internals}/FixedRouteFactory.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Internals}/LeakDetector.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Internals}/NavigationHelper.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Internals}/NavigationService.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Internals}/NavigationServiceProvider.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Internals}/NavigationStackPage.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation/Internals}/PageNavigationContext.cs (100%) create mode 100644 Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj create mode 100644 Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj.DotSettings rename Source/{Nalu.Maui/Nalu.Maui.targets => Nalu.Maui.Navigation/Nalu.Maui.Navigation.targets} (100%) rename Source/{Nalu.Maui => Nalu.Maui.Navigation}/Nalu.Maui.csproj.DotSettings (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NaluShell.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigateCommand.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationBehavior.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationConfigurator.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/AbsoluteNavigation.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/INavigationInfo.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/INavigationSegment.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/Navigation.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/NavigationExtensions.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/NavigationPop.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/NavigationSegment.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/NavigationSegmentAttribute.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/NavigationInfo/RelativeNavigation.cs (100%) create mode 100644 Source/Nalu.Maui.Navigation/Platforms/Android/.gitkeep create mode 100644 Source/Nalu.Maui.Navigation/Platforms/MacCatalyst/.gitkeep create mode 100644 Source/Nalu.Maui.Navigation/Platforms/Windows/.gitkeep create mode 100644 Source/Nalu.Maui.Navigation/Platforms/iOS/.gitkeep rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/IShellContentProxy.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/IShellItemProxy.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/IShellProxy.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/IShellSectionProxy.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/ShellContentProxy.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/ShellItemProxy.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/ShellProxy.cs (100%) rename Source/{Nalu.Maui/Navigation => Nalu.Maui.Navigation}/ShellInfo/ShellSectionProxy.cs (100%) delete mode 100644 Source/Nalu.Maui/Navigation/NavigationLevel.cs diff --git a/Directory.Build.props b/Directory.Build.props index 364bc44..69de922 100644 --- a/Directory.Build.props +++ b/Directory.Build.props @@ -7,6 +7,7 @@ enable enable true + 8.0.10 diff --git a/Nalu.sln b/Nalu.sln index 714444a..832ac43 100644 --- a/Nalu.sln +++ b/Nalu.sln @@ -79,6 +79,10 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nalu.Maui.Sample", "Samples EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nalu.Maui.DefaultShellSample", "Samples\Nalu.Maui.DefaultShellSample\Nalu.Maui.DefaultShellSample.csproj", "{D64BF572-B11E-4068-8848-70F3FF0FF2DF}" EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nalu.Maui.Navigation", "Source\Nalu.Maui.Navigation\Nalu.Maui.Navigation.csproj", "{CEB939B1-E5A5-462A-834F-7D32D1893444}" +EndProject +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Nalu.Maui.Core", "Source\Nalu.Maui.Core\Nalu.Maui.Core.csproj", "{BD63D735-B1BF-42CC-936E-A97991F29B1D}" +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -99,6 +103,14 @@ Global {D64BF572-B11E-4068-8848-70F3FF0FF2DF}.Debug|Any CPU.ActiveCfg = Debug|Any CPU {D64BF572-B11E-4068-8848-70F3FF0FF2DF}.Debug|Any CPU.Build.0 = Debug|Any CPU {D64BF572-B11E-4068-8848-70F3FF0FF2DF}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CEB939B1-E5A5-462A-834F-7D32D1893444}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {CEB939B1-E5A5-462A-834F-7D32D1893444}.Debug|Any CPU.Build.0 = Debug|Any CPU + {CEB939B1-E5A5-462A-834F-7D32D1893444}.Release|Any CPU.ActiveCfg = Release|Any CPU + {CEB939B1-E5A5-462A-834F-7D32D1893444}.Release|Any CPU.Build.0 = Release|Any CPU + {BD63D735-B1BF-42CC-936E-A97991F29B1D}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {BD63D735-B1BF-42CC-936E-A97991F29B1D}.Debug|Any CPU.Build.0 = Debug|Any CPU + {BD63D735-B1BF-42CC-936E-A97991F29B1D}.Release|Any CPU.ActiveCfg = Release|Any CPU + {BD63D735-B1BF-42CC-936E-A97991F29B1D}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE @@ -112,6 +124,8 @@ Global {5067A8EE-4496-4F5A-A5FB-4D66B89363E1} = {E1B24F25-B8A4-46EE-B7EB-7803DCFC543F} {959B003B-842C-473F-99E5-E905642AFDAF} = {00000000-0000-0000-0000-000000000000} {D64BF572-B11E-4068-8848-70F3FF0FF2DF} = {00000000-0000-0000-0000-000000000000} + {CEB939B1-E5A5-462A-834F-7D32D1893444} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0} + {BD63D735-B1BF-42CC-936E-A97991F29B1D} = {719809C2-A551-4C4A-9EFD-B10FB5E35BC0} EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution SolutionGuid = {73F36209-F8D6-4066-8951-D97729F773CF} diff --git a/Samples/Directory.Build.props b/Samples/Directory.Build.props index 8446502..7cf604c 100644 --- a/Samples/Directory.Build.props +++ b/Samples/Directory.Build.props @@ -6,6 +6,7 @@ enable enable false + 8.0.10 diff --git a/Samples/Nalu.Maui.DefaultShellSample/App.xaml b/Samples/Nalu.Maui.DefaultShellSample/App.xaml index 465a56f..4fa1fbb 100644 --- a/Samples/Nalu.Maui.DefaultShellSample/App.xaml +++ b/Samples/Nalu.Maui.DefaultShellSample/App.xaml @@ -1,7 +1,6 @@  diff --git a/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj b/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj index ee53547..5ff7c90 100644 --- a/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj +++ b/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj @@ -13,11 +13,9 @@ Exe Nalu.Maui.DefaultShellSample - true true enable enable - 8.0.7 Nalu.Maui.DefaultShellSample diff --git a/Samples/Nalu.Maui.Sample/AppShell.xaml b/Samples/Nalu.Maui.Sample/AppShell.xaml index aad9ece..2a8fb9e 100644 --- a/Samples/Nalu.Maui.Sample/AppShell.xaml +++ b/Samples/Nalu.Maui.Sample/AppShell.xaml @@ -2,7 +2,7 @@ Exe Nalu.Maui.Sample - true true enable enable - 8.0.7 Nalu.Maui.Sample diff --git a/Samples/Nalu.Maui.Sample/Pages/TwoPage.xaml b/Samples/Nalu.Maui.Sample/Pages/TwoPage.xaml index b27c2a4..46e5d27 100644 --- a/Samples/Nalu.Maui.Sample/Pages/TwoPage.xaml +++ b/Samples/Nalu.Maui.Sample/Pages/TwoPage.xaml @@ -3,7 +3,7 @@ + + Nalu.Maui.Core + .NET MAUI developer utilities + MAUI + Nalu + + + + net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + true + Library + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + + + + + + <_Parameter1>Nalu.Maui.Test + + + <_Parameter1>DynamicProxyGenAssembly2 + + + <_Parameter1>https://nalu-development.github.com/nalu/core + <_Parameter2>$(RootNamespace) + + + + + + + + + + + + + diff --git a/Source/Nalu.Maui/Platforms/Android/.gitkeep b/Source/Nalu.Maui.Core/Platforms/Android/.gitkeep similarity index 100% rename from Source/Nalu.Maui/Platforms/Android/.gitkeep rename to Source/Nalu.Maui.Core/Platforms/Android/.gitkeep diff --git a/Source/Nalu.Maui/Platforms/MacCatalyst/.gitkeep b/Source/Nalu.Maui.Core/Platforms/MacCatalyst/.gitkeep similarity index 100% rename from Source/Nalu.Maui/Platforms/MacCatalyst/.gitkeep rename to Source/Nalu.Maui.Core/Platforms/MacCatalyst/.gitkeep diff --git a/Source/Nalu.Maui/Platforms/Windows/.gitkeep b/Source/Nalu.Maui.Core/Platforms/Windows/.gitkeep similarity index 100% rename from Source/Nalu.Maui/Platforms/Windows/.gitkeep rename to Source/Nalu.Maui.Core/Platforms/Windows/.gitkeep diff --git a/Source/Nalu.Maui/Platforms/iOS/.gitkeep b/Source/Nalu.Maui.Core/Platforms/iOS/.gitkeep similarity index 100% rename from Source/Nalu.Maui/Platforms/iOS/.gitkeep rename to Source/Nalu.Maui.Core/Platforms/iOS/.gitkeep diff --git a/Source/Nalu.Maui/Extensions/NaluMauiAppBuilderExtensions.cs b/Source/Nalu.Maui.Navigation/Extensions/NaluMauiAppBuilderExtensions.cs similarity index 100% rename from Source/Nalu.Maui/Extensions/NaluMauiAppBuilderExtensions.cs rename to Source/Nalu.Maui.Navigation/Extensions/NaluMauiAppBuilderExtensions.cs diff --git a/Source/Nalu.Maui/Extensions/NaluMauiNavigationExtensions.cs b/Source/Nalu.Maui.Navigation/Extensions/NaluMauiNavigationExtensions.cs similarity index 100% rename from Source/Nalu.Maui/Extensions/NaluMauiNavigationExtensions.cs rename to Source/Nalu.Maui.Navigation/Extensions/NaluMauiNavigationExtensions.cs diff --git a/Source/Nalu.Maui/Images/nalu_navigation_arrow_back_android.svg b/Source/Nalu.Maui.Navigation/Images/nalu_navigation_arrow_back_android.svg similarity index 100% rename from Source/Nalu.Maui/Images/nalu_navigation_arrow_back_android.svg rename to Source/Nalu.Maui.Navigation/Images/nalu_navigation_arrow_back_android.svg diff --git a/Source/Nalu.Maui/Images/nalu_navigation_arrow_back_ios.svg b/Source/Nalu.Maui.Navigation/Images/nalu_navigation_arrow_back_ios.svg similarity index 100% rename from Source/Nalu.Maui/Images/nalu_navigation_arrow_back_ios.svg rename to Source/Nalu.Maui.Navigation/Images/nalu_navigation_arrow_back_ios.svg diff --git a/Source/Nalu.Maui/Images/nalu_navigation_menu.svg b/Source/Nalu.Maui.Navigation/Images/nalu_navigation_menu.svg similarity index 100% rename from Source/Nalu.Maui/Images/nalu_navigation_menu.svg rename to Source/Nalu.Maui.Navigation/Images/nalu_navigation_menu.svg diff --git a/Source/Nalu.Maui/Navigation/IAppearingAware.cs b/Source/Nalu.Maui.Navigation/Interfaces/IAppearingAware.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/IAppearingAware.cs rename to Source/Nalu.Maui.Navigation/Interfaces/IAppearingAware.cs diff --git a/Source/Nalu.Maui/Navigation/IDisappearingAware.cs b/Source/Nalu.Maui.Navigation/Interfaces/IDisappearingAware.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/IDisappearingAware.cs rename to Source/Nalu.Maui.Navigation/Interfaces/IDisappearingAware.cs diff --git a/Source/Nalu.Maui/Navigation/IEnteringAware.cs b/Source/Nalu.Maui.Navigation/Interfaces/IEnteringAware.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/IEnteringAware.cs rename to Source/Nalu.Maui.Navigation/Interfaces/IEnteringAware.cs diff --git a/Source/Nalu.Maui/Navigation/ILeavingAware.cs b/Source/Nalu.Maui.Navigation/Interfaces/ILeavingAware.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ILeavingAware.cs rename to Source/Nalu.Maui.Navigation/Interfaces/ILeavingAware.cs diff --git a/Source/Nalu.Maui/Navigation/ILeavingGuard.cs b/Source/Nalu.Maui.Navigation/Interfaces/ILeavingGuard.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ILeavingGuard.cs rename to Source/Nalu.Maui.Navigation/Interfaces/ILeavingGuard.cs diff --git a/Source/Nalu.Maui/Navigation/INaluShell.cs b/Source/Nalu.Maui.Navigation/Interfaces/INaluShell.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/INaluShell.cs rename to Source/Nalu.Maui.Navigation/Interfaces/INaluShell.cs diff --git a/Source/Nalu.Maui/Navigation/INavigationConfiguration.cs b/Source/Nalu.Maui.Navigation/Interfaces/INavigationConfiguration.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/INavigationConfiguration.cs rename to Source/Nalu.Maui.Navigation/Interfaces/INavigationConfiguration.cs diff --git a/Source/Nalu.Maui/Navigation/INavigationService.cs b/Source/Nalu.Maui.Navigation/Interfaces/INavigationService.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/INavigationService.cs rename to Source/Nalu.Maui.Navigation/Interfaces/INavigationService.cs diff --git a/Source/Nalu.Maui/Navigation/INavigationServiceProvider.cs b/Source/Nalu.Maui.Navigation/Interfaces/INavigationServiceProvider.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/INavigationServiceProvider.cs rename to Source/Nalu.Maui.Navigation/Interfaces/INavigationServiceProvider.cs diff --git a/Source/Nalu.Maui/Navigation/INavigationServiceProviderInternal.cs b/Source/Nalu.Maui.Navigation/Interfaces/INavigationServiceProviderInternal.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/INavigationServiceProviderInternal.cs rename to Source/Nalu.Maui.Navigation/Interfaces/INavigationServiceProviderInternal.cs diff --git a/Source/Nalu.Maui/Navigation/FixedRouteFactory.cs b/Source/Nalu.Maui.Navigation/Internals/FixedRouteFactory.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/FixedRouteFactory.cs rename to Source/Nalu.Maui.Navigation/Internals/FixedRouteFactory.cs diff --git a/Source/Nalu.Maui/Navigation/LeakDetector.cs b/Source/Nalu.Maui.Navigation/Internals/LeakDetector.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/LeakDetector.cs rename to Source/Nalu.Maui.Navigation/Internals/LeakDetector.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationHelper.cs b/Source/Nalu.Maui.Navigation/Internals/NavigationHelper.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationHelper.cs rename to Source/Nalu.Maui.Navigation/Internals/NavigationHelper.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationService.cs b/Source/Nalu.Maui.Navigation/Internals/NavigationService.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationService.cs rename to Source/Nalu.Maui.Navigation/Internals/NavigationService.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationServiceProvider.cs b/Source/Nalu.Maui.Navigation/Internals/NavigationServiceProvider.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationServiceProvider.cs rename to Source/Nalu.Maui.Navigation/Internals/NavigationServiceProvider.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationStackPage.cs b/Source/Nalu.Maui.Navigation/Internals/NavigationStackPage.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationStackPage.cs rename to Source/Nalu.Maui.Navigation/Internals/NavigationStackPage.cs diff --git a/Source/Nalu.Maui/Navigation/PageNavigationContext.cs b/Source/Nalu.Maui.Navigation/Internals/PageNavigationContext.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/PageNavigationContext.cs rename to Source/Nalu.Maui.Navigation/Internals/PageNavigationContext.cs diff --git a/Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj b/Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj new file mode 100644 index 0000000..4802cb5 --- /dev/null +++ b/Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj @@ -0,0 +1,64 @@ + + + Nalu.Maui + .NET MAUI developer utilities + MAUI + Nalu + + + + net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst + $(TargetFrameworks);net8.0-windows10.0.19041.0 + + true + Library + + 11.0 + 13.1 + 21.0 + 10.0.17763.0 + 10.0.17763.0 + + + + + + <_Parameter1>Nalu.Maui.Test + + + <_Parameter1>DynamicProxyGenAssembly2 + + + <_Parameter1>https://nalu-development.github.com/nalu/navigation + <_Parameter2>$(RootNamespace) + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj.DotSettings b/Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj.DotSettings new file mode 100644 index 0000000..6a3f8b8 --- /dev/null +++ b/Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.csproj.DotSettings @@ -0,0 +1,6 @@ + + True + True + True + True + True \ No newline at end of file diff --git a/Source/Nalu.Maui/Nalu.Maui.targets b/Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.targets similarity index 100% rename from Source/Nalu.Maui/Nalu.Maui.targets rename to Source/Nalu.Maui.Navigation/Nalu.Maui.Navigation.targets diff --git a/Source/Nalu.Maui/Nalu.Maui.csproj.DotSettings b/Source/Nalu.Maui.Navigation/Nalu.Maui.csproj.DotSettings similarity index 100% rename from Source/Nalu.Maui/Nalu.Maui.csproj.DotSettings rename to Source/Nalu.Maui.Navigation/Nalu.Maui.csproj.DotSettings diff --git a/Source/Nalu.Maui/Navigation/NaluShell.cs b/Source/Nalu.Maui.Navigation/NaluShell.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NaluShell.cs rename to Source/Nalu.Maui.Navigation/NaluShell.cs diff --git a/Source/Nalu.Maui/Navigation/NavigateCommand.cs b/Source/Nalu.Maui.Navigation/NavigateCommand.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigateCommand.cs rename to Source/Nalu.Maui.Navigation/NavigateCommand.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationBehavior.cs b/Source/Nalu.Maui.Navigation/NavigationBehavior.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationBehavior.cs rename to Source/Nalu.Maui.Navigation/NavigationBehavior.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationConfigurator.cs b/Source/Nalu.Maui.Navigation/NavigationConfigurator.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationConfigurator.cs rename to Source/Nalu.Maui.Navigation/NavigationConfigurator.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/AbsoluteNavigation.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/AbsoluteNavigation.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/AbsoluteNavigation.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/AbsoluteNavigation.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/INavigationInfo.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/INavigationInfo.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/INavigationInfo.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/INavigationInfo.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/INavigationSegment.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/INavigationSegment.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/INavigationSegment.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/INavigationSegment.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/Navigation.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/Navigation.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/Navigation.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/Navigation.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/NavigationExtensions.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/NavigationExtensions.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/NavigationExtensions.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/NavigationExtensions.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/NavigationPop.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/NavigationPop.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/NavigationPop.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/NavigationPop.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/NavigationSegment.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/NavigationSegment.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/NavigationSegment.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/NavigationSegment.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/NavigationSegmentAttribute.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/NavigationSegmentAttribute.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/NavigationSegmentAttribute.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/NavigationSegmentAttribute.cs diff --git a/Source/Nalu.Maui/Navigation/NavigationInfo/RelativeNavigation.cs b/Source/Nalu.Maui.Navigation/NavigationInfo/RelativeNavigation.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/NavigationInfo/RelativeNavigation.cs rename to Source/Nalu.Maui.Navigation/NavigationInfo/RelativeNavigation.cs diff --git a/Source/Nalu.Maui.Navigation/Platforms/Android/.gitkeep b/Source/Nalu.Maui.Navigation/Platforms/Android/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Source/Nalu.Maui.Navigation/Platforms/MacCatalyst/.gitkeep b/Source/Nalu.Maui.Navigation/Platforms/MacCatalyst/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Source/Nalu.Maui.Navigation/Platforms/Windows/.gitkeep b/Source/Nalu.Maui.Navigation/Platforms/Windows/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Source/Nalu.Maui.Navigation/Platforms/iOS/.gitkeep b/Source/Nalu.Maui.Navigation/Platforms/iOS/.gitkeep new file mode 100644 index 0000000..e69de29 diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/IShellContentProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/IShellContentProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/IShellContentProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/IShellContentProxy.cs diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/IShellItemProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/IShellItemProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/IShellItemProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/IShellItemProxy.cs diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/IShellProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/IShellProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/IShellProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/IShellProxy.cs diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/IShellSectionProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/IShellSectionProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/IShellSectionProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/IShellSectionProxy.cs diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/ShellContentProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/ShellContentProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/ShellContentProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/ShellContentProxy.cs diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/ShellItemProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/ShellItemProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/ShellItemProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/ShellItemProxy.cs diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/ShellProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/ShellProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/ShellProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/ShellProxy.cs diff --git a/Source/Nalu.Maui/Navigation/ShellInfo/ShellSectionProxy.cs b/Source/Nalu.Maui.Navigation/ShellInfo/ShellSectionProxy.cs similarity index 100% rename from Source/Nalu.Maui/Navigation/ShellInfo/ShellSectionProxy.cs rename to Source/Nalu.Maui.Navigation/ShellInfo/ShellSectionProxy.cs diff --git a/Source/Nalu.Maui/Nalu.Maui.csproj b/Source/Nalu.Maui/Nalu.Maui.csproj index 1cee5eb..34db4a4 100644 --- a/Source/Nalu.Maui/Nalu.Maui.csproj +++ b/Source/Nalu.Maui/Nalu.Maui.csproj @@ -10,7 +10,6 @@ net8.0;net8.0-android;net8.0-ios;net8.0-maccatalyst $(TargetFrameworks);net8.0-windows10.0.19041.0 - true true Library @@ -23,39 +22,7 @@ - - <_Parameter1>Nalu.Maui.Test - - - <_Parameter1>DynamicProxyGenAssembly2 - - - <_Parameter1>https://nalu-development.github.com/nalu - <_Parameter2>Nalu - - - - - - - - - - - - - - - - - - - - - - - - - + + diff --git a/Source/Nalu.Maui/Navigation/NavigationLevel.cs b/Source/Nalu.Maui/Navigation/NavigationLevel.cs deleted file mode 100644 index 88f905b..0000000 --- a/Source/Nalu.Maui/Navigation/NavigationLevel.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Nalu; - -internal enum NavigationLevel -{ - /// - /// Navigation targeting the current . - /// - Section, - - /// - /// Navigation targeting the current . - /// - Item, - - /// - /// Navigation targeting a different from the current one. - /// - Shell, -} From c75986216ef89d9d96df2d2ec7dc4b716f7cfa7a Mon Sep 17 00:00:00 2001 From: Alberto Aldegheri Date: Sun, 17 Mar 2024 19:36:01 +0100 Subject: [PATCH 2/3] Batch navigation --- .../Nalu.Maui.DefaultShellSample.csproj | 1 + .../Nalu.Maui.Sample/Nalu.Maui.Sample.csproj | 1 + .../PageModels/FivePageModel.cs | 6 +- .../PageModels/FourPageModel.cs | 2 +- .../PageModels/ThreePageModel.cs | 3 + Samples/Nalu.Maui.Sample/Pages/FivePage.xaml | 3 +- .../Nalu.Maui.Sample/Pages/FivePage.xaml.cs | 2 +- Samples/Nalu.Maui.Sample/Pages/ThreePage.xaml | 2 + .../Internals/NavigationService.cs | 213 ++++++++++++------ .../Internals/PageNavigationContext.cs | 13 +- .../ShellInfo/IShellProxy.cs | 2 + .../ShellInfo/IShellSectionProxy.cs | 3 +- .../ShellInfo/ShellProxy.cs | 104 ++++++++- .../ShellInfo/ShellSectionProxy.cs | 18 +- .../NavigationServiceTests.Fixtures.cs | 19 +- .../Navigation/NavigationServiceTests.cs | 38 ++-- 16 files changed, 325 insertions(+), 105 deletions(-) diff --git a/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj b/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj index 5ff7c90..c120fc8 100644 --- a/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj +++ b/Samples/Nalu.Maui.DefaultShellSample/Nalu.Maui.DefaultShellSample.csproj @@ -16,6 +16,7 @@ true enable enable + true Nalu.Maui.DefaultShellSample diff --git a/Samples/Nalu.Maui.Sample/Nalu.Maui.Sample.csproj b/Samples/Nalu.Maui.Sample/Nalu.Maui.Sample.csproj index 6a6175d..2ad9178 100644 --- a/Samples/Nalu.Maui.Sample/Nalu.Maui.Sample.csproj +++ b/Samples/Nalu.Maui.Sample/Nalu.Maui.Sample.csproj @@ -16,6 +16,7 @@ true enable enable + true Nalu.Maui.Sample diff --git a/Samples/Nalu.Maui.Sample/PageModels/FivePageModel.cs b/Samples/Nalu.Maui.Sample/PageModels/FivePageModel.cs index 4a216d4..3ab04c1 100644 --- a/Samples/Nalu.Maui.Sample/PageModels/FivePageModel.cs +++ b/Samples/Nalu.Maui.Sample/PageModels/FivePageModel.cs @@ -1,10 +1,14 @@ namespace Nalu.Maui.Sample.PageModels; using CommunityToolkit.Mvvm.ComponentModel; +using CommunityToolkit.Mvvm.Input; -public class FivePageModel : ObservableObject +public partial class FivePageModel(INavigationService navigationService) : ObservableObject { private static int _instanceCount; public int InstanceCount { get; } = Interlocked.Increment(ref _instanceCount); + + [RelayCommand] + private Task GoToThreeAsync() => navigationService.GoToAsync(Navigation.Absolute().ShellContent().Add()); } diff --git a/Samples/Nalu.Maui.Sample/PageModels/FourPageModel.cs b/Samples/Nalu.Maui.Sample/PageModels/FourPageModel.cs index 6144111..84069df 100644 --- a/Samples/Nalu.Maui.Sample/PageModels/FourPageModel.cs +++ b/Samples/Nalu.Maui.Sample/PageModels/FourPageModel.cs @@ -17,7 +17,7 @@ public partial class FourPageModel(INavigationService navigationService) : Obser private Task NavigateToTwoAsync() => navigationService.GoToAsync(Navigation.Relative()); [RelayCommand(AllowConcurrentExecutions = false)] - private Task NavigateToFiveAsync() => navigationService.GoToAsync(Navigation.Absolute().ShellContent()); + private Task NavigateToFiveAsync() => navigationService.GoToAsync(Navigation.Absolute(NavigationBehavior.PopAllPagesOnItemChange | NavigationBehavior.IgnoreGuards).ShellContent()); [RelayCommand(AllowConcurrentExecutions = false)] private Task NavigateToSevenAsync() => navigationService.GoToAsync(Navigation.Absolute().ShellContent()); diff --git a/Samples/Nalu.Maui.Sample/PageModels/ThreePageModel.cs b/Samples/Nalu.Maui.Sample/PageModels/ThreePageModel.cs index 2e53425..f520513 100644 --- a/Samples/Nalu.Maui.Sample/PageModels/ThreePageModel.cs +++ b/Samples/Nalu.Maui.Sample/PageModels/ThreePageModel.cs @@ -14,6 +14,9 @@ public partial class ThreePageModel(INavigationService navigationService, IPopup [RelayCommand(AllowConcurrentExecutions = false)] private Task PushFourAsync() => navigationService.GoToAsync(Navigation.Relative().Push()); + [RelayCommand(AllowConcurrentExecutions = false)] + private Task ReplaceSixAsync() => navigationService.GoToAsync(Navigation.Relative(NavigationBehavior.IgnoreGuards).Pop().Push()); + public async ValueTask CanLeaveAsync() // this will leak: https://github.com/CommunityToolkit/Maui/issues/1676 => (bool)(await popupService.ShowPopupAsync() ?? false); diff --git a/Samples/Nalu.Maui.Sample/Pages/FivePage.xaml b/Samples/Nalu.Maui.Sample/Pages/FivePage.xaml index 5f195d9..b330a6b 100644 --- a/Samples/Nalu.Maui.Sample/Pages/FivePage.xaml +++ b/Samples/Nalu.Maui.Sample/Pages/FivePage.xaml @@ -2,8 +2,6 @@ +