├── .editorconfig ├── .gitattributes ├── .github ├── ISSUE_TEMPLATE │ ├── bug_report.md │ └── feature_request.md └── workflows │ ├── dotnet-desktop.yml │ └── release.yml ├── .gitignore ├── Directory.Build.props ├── LICENSE.txt ├── Lemon.ModuleNavigation.sln ├── README.md ├── breakdownchanges.md ├── lemon-100.png ├── samples ├── Lemon.ModuleNavigation.Sample.Browser │ ├── Lemon.ModuleNavigation.Sample.Browser.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── runtimeconfig.template.json │ └── wwwroot │ │ ├── app.css │ │ ├── favicon.ico │ │ ├── index.html │ │ └── main.js ├── Lemon.ModuleNavigation.Sample.Desktop │ ├── Lemon.ModuleNavigation.Sample.Desktop.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ └── app.manifest ├── Lemon.ModuleNavigation.Sample.DesktopHosting │ ├── Lemon.ModuleNavigation.Sample.DesktopHosting.csproj │ ├── Program.cs │ ├── Properties │ │ └── launchSettings.json │ ├── app.manifest │ └── rd.xml ├── Lemon.ModuleNavigation.Sample │ ├── App.axaml │ ├── App.axaml.cs │ ├── AppWithDI.axaml.cs │ ├── AppWithDi.axaml │ ├── Assets │ │ ├── avalonia-logo.ico │ │ ├── lemon-100.ico │ │ ├── lemon-100.png │ │ ├── lemon-28.png │ │ └── lemon-50.png │ ├── DesignDatas │ │ └── MainWindowViewModel.cs │ ├── DialogWindows │ │ ├── CustomDialogWindow.axaml │ │ └── CustomDialogWindow.axaml.cs │ ├── Lemon.ModuleNavigation.Sample.csproj │ ├── ModuleAs │ │ ├── ModuleA.cs │ │ ├── ViewA.axaml │ │ ├── ViewA.axaml.cs │ │ └── ViewModelA.cs │ ├── ModuleBs │ │ ├── ModuleB.cs │ │ ├── ViewB.axaml │ │ ├── ViewB.axaml.cs │ │ └── ViewModelB.cs │ ├── ModuleCs │ │ ├── ModuleC.cs │ │ ├── SubModules │ │ │ ├── SubModule01.cs │ │ │ └── SubModule02.cs │ │ ├── ViewC.axaml │ │ ├── ViewC.axaml.cs │ │ ├── ViewModelC.cs │ │ ├── ViewModels │ │ │ ├── SubViewModel01.cs │ │ │ └── SubViewModel02.cs │ │ └── Views │ │ │ ├── SubView01.axaml │ │ │ ├── SubView01.axaml.cs │ │ │ ├── SubView02.axaml │ │ │ └── SubView02.axaml.cs │ ├── ViewModels │ │ └── MainViewModel.cs │ └── Views │ │ ├── MainView.axaml │ │ ├── MainView.axaml.cs │ │ ├── MainWindow.axaml │ │ ├── MainWindow.axaml.cs │ │ ├── ViewAlpha.axaml │ │ ├── ViewAlpha.axaml.cs │ │ ├── ViewBeta.axaml │ │ └── ViewBeta.axaml.cs ├── Lemon.ModuleNavigation.SampleViewModel │ ├── BaseNavigationViewModel.cs │ ├── Lemon.ModuleNavigation.SampleViewModel.csproj │ ├── MainWindowViewModel.cs │ ├── ViewAlphaViewModel.cs │ └── ViewBetaViewModel.cs └── Lemon.ModuleNavigation.WpfSample │ ├── App.xaml │ ├── App.xaml.cs │ ├── AssemblyInfo.cs │ ├── BoolToVisibilityConverter.cs │ ├── Lemon.ModuleNavigation.WpfSample.csproj │ ├── MainWindow.xaml │ ├── MainWindow.xaml.cs │ └── Views │ ├── ViewAlpha.xaml │ ├── ViewAlpha.xaml.cs │ ├── ViewBeta.xaml │ └── ViewBeta.xaml.cs └── src ├── Lemon.ModuleNavigation.Avaloniaui ├── AssemblyInfo.cs ├── AvaModule{TView,TViewModel}.cs ├── DefaultDialogWindow.axaml ├── DefaultDialogWindow.axaml.cs ├── DialogService.cs ├── Extensions │ ├── AvaloniauiExtensions.cs │ └── ServiceCollectionExtensions.cs ├── IDialogWindow.cs ├── Lemon.ModuleNavigation.Avaloniaui.csproj ├── NavigationExtension.cs ├── Regions │ ├── ContentRegion.cs │ ├── ItemsRegion.cs │ ├── Region.cs │ └── TabRegion.cs ├── RegionsExtension.cs └── RegionsOld │ ├── ContentRegion.cs │ ├── ItemsRegion.cs │ ├── RegionBak.cs │ └── TabRegion.cs ├── Lemon.ModuleNavigation.Wpf ├── AssemblyInfo.cs ├── DefaultDialogWindow.xaml ├── DefaultDialogWindow.xaml.cs ├── DialogService.cs ├── Extensions │ ├── ServiceCollectionExtensions.cs │ └── WpfExtensions.cs ├── IDialogWindow.cs ├── Lemon.ModuleNavigation.Wpf.csproj ├── NavigationExtension.cs └── Regions │ ├── ContentRegion.cs │ ├── ItemsRegion.cs │ ├── Region.cs │ └── TabRegion.cs ├── Lemon.ModuleNavigation ├── Abstractions │ ├── BaseParameters.cs │ ├── IContentRegionContext{TDataTemplate}.cs │ ├── IDialogAware.cs │ ├── IDialogParameters.cs │ ├── IDialogResult.cs │ ├── IDialogService.cs │ ├── IDialogWindow.cs │ ├── IItemsRegionDataContext{TDataTemplate}.cs │ ├── IModule.cs │ ├── IModuleManager.cs │ ├── IModuleNavigationAware.cs │ ├── IModuleNavigationHandler.cs │ ├── IModuleNavigationHandler{T}.cs │ ├── IModuleNavigationService.cs │ ├── IModuleNavigationService{T}.cs │ ├── IModuleScope.cs │ ├── IModuleServiceProvider.cs │ ├── INavigationAware.cs │ ├── INavigationHandler.cs │ ├── INavigationService.cs │ ├── IRegion.cs │ ├── IRegionManager.cs │ ├── IServiceAware.cs │ ├── IServiceProviderDecorator.cs │ ├── IView.cs │ ├── IViewManager.cs │ ├── IViewNavigationHandler.cs │ └── IViewNavigationService.cs ├── Core │ ├── ButtonResult.cs │ ├── ConcurrentItem.cs │ ├── DialogParameters.cs │ ├── DialogResult.cs │ ├── NavigationParameters.cs │ └── RegionNameNotFoundException.cs ├── Extensions │ ├── ListKeyValuePairExtensions.cs │ ├── ObservableExtension.cs │ └── ServiceCollectionExtensions.cs ├── Internal │ ├── ConcurrentSet.cs │ ├── DisposableAction.cs │ └── ModuleServiceProvider.cs ├── Lemon.ModuleNavigation.csproj ├── ModuleManager.cs ├── Module{TView,TViewModel}.cs ├── NavigationContext.cs ├── NavigationHandler.cs ├── NavigationService.cs ├── RegionManager.cs ├── ServiceProviderDecorator.cs ├── ViewDiscription.cs ├── ViewId.cs └── ViewManager.cs └── Package.props /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.cs] 2 | 3 | # IDE0290: Use primary constructor 4 | dotnet_diagnostic.IDE0290.severity = none 5 | -------------------------------------------------------------------------------- /.gitattributes: -------------------------------------------------------------------------------- 1 | ############################################################################### 2 | # Set default behavior to automatically normalize line endings. 3 | ############################################################################### 4 | * text=auto 5 | 6 | ############################################################################### 7 | # Set default behavior for command prompt diff. 8 | # 9 | # This is need for earlier builds of msysgit that does not have it on by 10 | # default for csharp files. 11 | # Note: This is only used by command line 12 | ############################################################################### 13 | #*.cs diff=csharp 14 | 15 | ############################################################################### 16 | # Set the merge driver for project and solution files 17 | # 18 | # Merging from the command prompt will add diff markers to the files if there 19 | # are conflicts (Merging from VS is not affected by the settings below, in VS 20 | # the diff markers are never inserted). Diff markers may cause the following 21 | # file extensions to fail to load in VS. An alternative would be to treat 22 | # these files as binary and thus will always conflict and require user 23 | # intervention with every merge. To do so, just uncomment the entries below 24 | ############################################################################### 25 | #*.sln merge=binary 26 | #*.csproj merge=binary 27 | #*.vbproj merge=binary 28 | #*.vcxproj merge=binary 29 | #*.vcproj merge=binary 30 | #*.dbproj merge=binary 31 | #*.fsproj merge=binary 32 | #*.lsproj merge=binary 33 | #*.wixproj merge=binary 34 | #*.modelproj merge=binary 35 | #*.sqlproj merge=binary 36 | #*.wwaproj merge=binary 37 | 38 | ############################################################################### 39 | # behavior for image files 40 | # 41 | # image files are treated as binary by default. 42 | ############################################################################### 43 | #*.jpg binary 44 | #*.png binary 45 | #*.gif binary 46 | 47 | ############################################################################### 48 | # diff behavior for common document formats 49 | # 50 | # Convert binary document formats to text before diffing them. This feature 51 | # is only available from the command line. Turn it on by uncommenting the 52 | # entries below. 53 | ############################################################################### 54 | #*.doc diff=astextplain 55 | #*.DOC diff=astextplain 56 | #*.docx diff=astextplain 57 | #*.DOCX diff=astextplain 58 | #*.dot diff=astextplain 59 | #*.DOT diff=astextplain 60 | #*.pdf diff=astextplain 61 | #*.PDF diff=astextplain 62 | #*.rtf diff=astextplain 63 | #*.RTF diff=astextplain 64 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/bug_report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us improve 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Describe the bug** 11 | A clear and concise description of what the bug is. 12 | 13 | **To Reproduce** 14 | Steps to reproduce the behavior: 15 | 1. Go to '...' 16 | 2. Click on '....' 17 | 3. Scroll down to '....' 18 | 4. See error 19 | 20 | **Expected behavior** 21 | A clear and concise description of what you expected to happen. 22 | 23 | **Screenshots** 24 | If applicable, add screenshots to help explain your problem. 25 | 26 | **Environment(please complete the following information):** 27 | - OS: [e.g. Windows 11 ,linux ubuntu 20.04.6] 28 | - Nuget:[e.g. 1.0.0] 29 | 30 | **Additional context** 31 | Add any other context about the problem here. 32 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature_request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Suggest an idea for this project 4 | title: '' 5 | labels: '' 6 | assignees: '' 7 | 8 | --- 9 | 10 | **Is your feature request related to a problem? Please describe.** 11 | A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] 12 | 13 | **Describe the solution you'd like** 14 | A clear and concise description of what you want to happen. 15 | 16 | **Describe alternatives you've considered** 17 | A clear and concise description of any alternative solutions or features you've considered. 18 | 19 | **Additional context** 20 | Add any other context or screenshots about the feature request here. 21 | -------------------------------------------------------------------------------- /.github/workflows/dotnet-desktop.yml: -------------------------------------------------------------------------------- 1 | name: .NET 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths-ignore: 8 | - 'README.md' 9 | pull_request: 10 | branches: 11 | - master 12 | paths-ignore: 13 | - 'README.md' 14 | 15 | jobs: 16 | build-avaloniaui: 17 | runs-on: ${{ matrix.os }} 18 | strategy: 19 | matrix: 20 | os: [windows-2022, ubuntu-22.04, macos-13] 21 | steps: 22 | - uses: actions/checkout@v3 23 | - name: Setup .NET 8 24 | uses: actions/setup-dotnet@v3 25 | with: 26 | dotnet-version: 8.0.x 27 | - name: Install dependencies 28 | run: dotnet restore 29 | working-directory: samples/Lemon.ModuleNavigation.Sample.Desktop 30 | - name: Build 31 | run: dotnet build --configuration Release --no-restore 32 | working-directory: samples/Lemon.ModuleNavigation.Sample.Desktop 33 | build-wpf: 34 | runs-on: windows-2022 35 | steps: 36 | - uses: actions/checkout@v3 37 | - name: Setup .NET 8 38 | uses: actions/setup-dotnet@v3 39 | with: 40 | dotnet-version: 8.0.x 41 | - name: Install dependencies 42 | run: dotnet restore 43 | working-directory: samples/Lemon.ModuleNavigation.WpfSample 44 | - name: Build WPF Sample 45 | run: dotnet build --configuration Release --no-restore 46 | working-directory: samples/Lemon.ModuleNavigation.WpfSample 47 | -------------------------------------------------------------------------------- /.github/workflows/release.yml: -------------------------------------------------------------------------------- 1 | name: Pack Nuget 2 | 3 | on: 4 | push: 5 | branches: [ "action/release" ] 6 | pull_request: 7 | branches: [ "action/release" ] 8 | 9 | jobs: 10 | nuget-abstraction: 11 | runs-on: ubuntu-latest 12 | steps: 13 | - name: Checkout 14 | uses: actions/checkout@v4.1.1 15 | 16 | - name: Build the Project 17 | run: dotnet build ./src/Lemon.ModuleNavigation --configuration Release 18 | 19 | - name: Pack Nuget 20 | run: dotnet pack ./src/Lemon.ModuleNavigation --configuration Release --no-build -o ./nugets 21 | 22 | - name: Publish NuGet package 23 | run: | 24 | if [ -n "$(find ./nugets -name '*.nupkg')" ]; then 25 | dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate 26 | fi 27 | 28 | - name: Upload a Build Artifact 29 | uses: actions/upload-artifact@v4.3.1 30 | with: 31 | name: nugets-abstraction 32 | path: ./nugets 33 | 34 | nuget-avaloniaui: 35 | runs-on: ubuntu-latest 36 | steps: 37 | - name: Checkout 38 | uses: actions/checkout@v4.1.1 39 | 40 | - name: Build the Project 41 | run: dotnet build ./src/Lemon.ModuleNavigation.Avaloniaui --configuration Release 42 | 43 | - name: Pack Nuget 44 | run: dotnet pack ./src/Lemon.ModuleNavigation.Avaloniaui --configuration Release --no-build -o ./nugets 45 | 46 | - name: Publish NuGet package 47 | run: | 48 | if [ -n "$(find ./nugets -name '*.nupkg')" ]; then 49 | dotnet nuget push "./nugets/*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate 50 | fi 51 | 52 | - name: Upload a Build Artifact 53 | uses: actions/upload-artifact@v4.3.1 54 | with: 55 | name: nugets-avaloniaui 56 | path: ./nugets 57 | 58 | nuget-wpf: 59 | runs-on: windows-latest 60 | steps: 61 | - name: Checkout 62 | uses: actions/checkout@v4.1.1 63 | 64 | - name: Setup .NET 8 65 | uses: actions/setup-dotnet@v3 66 | with: 67 | dotnet-version: 8.0.x 68 | 69 | - name: Build the WPF Project 70 | run: dotnet build ./src/Lemon.ModuleNavigation.Wpf --configuration Release 71 | 72 | - name: Pack WPF Nuget 73 | run: dotnet pack ./src/Lemon.ModuleNavigation.Wpf --configuration Release --no-build -o ./nugets 74 | 75 | - name: Publish WPF NuGet package 76 | run: | 77 | if (Test-Path "./nugets/*.nupkg") { 78 | dotnet nuget push ".\nugets\*.nupkg" --api-key ${{ secrets.NUGET_API_KEY }} --source https://api.nuget.org/v3/index.json --skip-duplicate 79 | } 80 | 81 | - name: Upload WPF NuGet Artifact 82 | uses: actions/upload-artifact@v4.3.1 83 | with: 84 | name: nugets-wpf 85 | path: ./nugets 86 | -------------------------------------------------------------------------------- /Directory.Build.props: -------------------------------------------------------------------------------- 1 | 2 | 3 | enable 4 | 11.1.0 5 | 6 | 7 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) [year] [fullname] 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /Lemon.ModuleNavigation.sln: -------------------------------------------------------------------------------- 1 |  2 | Microsoft Visual Studio Solution File, Format Version 12.00 3 | # Visual Studio Version 17 4 | VisualStudioVersion = 17.11.35312.102 5 | MinimumVisualStudioVersion = 10.0.40219.1 6 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation", "src\Lemon.ModuleNavigation\Lemon.ModuleNavigation.csproj", "{9E271C3B-0D09-4318-BF49-4BE2952759D8}" 7 | EndProject 8 | Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{6E1EE4BE-93AB-4A7D-B080-E054855DDEA6}" 9 | ProjectSection(SolutionItems) = preProject 10 | .editorconfig = .editorconfig 11 | EndProjectSection 12 | EndProject 13 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Avaloniaui", "src\Lemon.ModuleNavigation.Avaloniaui\Lemon.ModuleNavigation.Avaloniaui.csproj", "{3EDBF55F-6D3E-4BD0-A726-4BA84461C687}" 14 | EndProject 15 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample", "samples\Lemon.ModuleNavigation.Sample\Lemon.ModuleNavigation.Sample.csproj", "{0CCB72E9-102B-41E2-80A4-67D580041508}" 16 | EndProject 17 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample.DesktopHosting", "samples\Lemon.ModuleNavigation.Sample.DesktopHosting\Lemon.ModuleNavigation.Sample.DesktopHosting.csproj", "{48509E81-7077-402B-A208-2134A7476857}" 18 | EndProject 19 | Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Lemon.ModuleNavigation.Sample.Desktop", "samples\Lemon.ModuleNavigation.Sample.Desktop\Lemon.ModuleNavigation.Sample.Desktop.csproj", "{AF18E2B0-7ED3-4BDA-81BA-6A23B3C89F39}" 20 | EndProject 21 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.Sample.Browser", "samples\Lemon.ModuleNavigation.Sample.Browser\Lemon.ModuleNavigation.Sample.Browser.csproj", "{FDD2C508-3201-4659-8962-886C2CBF41BD}" 22 | EndProject 23 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.Wpf", "src\Lemon.ModuleNavigation.Wpf\Lemon.ModuleNavigation.Wpf.csproj", "{2AE59E5E-900D-5CCB-0C30-F8DFAD324C9E}" 24 | EndProject 25 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.WpfSample", "samples\Lemon.ModuleNavigation.WpfSample\Lemon.ModuleNavigation.WpfSample.csproj", "{8EC545BD-E076-A2DF-A7A4-2F11221AF297}" 26 | EndProject 27 | Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Lemon.ModuleNavigation.SampleViewModel", "samples\Lemon.ModuleNavigation.SampleViewModel\Lemon.ModuleNavigation.SampleViewModel.csproj", "{99600F69-5901-4CEA-8C54-BFDC0751E207}" 28 | EndProject 29 | Global 30 | GlobalSection(SolutionConfigurationPlatforms) = preSolution 31 | Debug|Any CPU = Debug|Any CPU 32 | Release|Any CPU = Release|Any CPU 33 | EndGlobalSection 34 | GlobalSection(ProjectConfigurationPlatforms) = postSolution 35 | {9E271C3B-0D09-4318-BF49-4BE2952759D8}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 36 | {9E271C3B-0D09-4318-BF49-4BE2952759D8}.Debug|Any CPU.Build.0 = Debug|Any CPU 37 | {9E271C3B-0D09-4318-BF49-4BE2952759D8}.Release|Any CPU.ActiveCfg = Release|Any CPU 38 | {9E271C3B-0D09-4318-BF49-4BE2952759D8}.Release|Any CPU.Build.0 = Release|Any CPU 39 | {3EDBF55F-6D3E-4BD0-A726-4BA84461C687}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 40 | {3EDBF55F-6D3E-4BD0-A726-4BA84461C687}.Debug|Any CPU.Build.0 = Debug|Any CPU 41 | {3EDBF55F-6D3E-4BD0-A726-4BA84461C687}.Release|Any CPU.ActiveCfg = Release|Any CPU 42 | {3EDBF55F-6D3E-4BD0-A726-4BA84461C687}.Release|Any CPU.Build.0 = Release|Any CPU 43 | {0CCB72E9-102B-41E2-80A4-67D580041508}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 44 | {0CCB72E9-102B-41E2-80A4-67D580041508}.Debug|Any CPU.Build.0 = Debug|Any CPU 45 | {0CCB72E9-102B-41E2-80A4-67D580041508}.Release|Any CPU.ActiveCfg = Release|Any CPU 46 | {0CCB72E9-102B-41E2-80A4-67D580041508}.Release|Any CPU.Build.0 = Release|Any CPU 47 | {48509E81-7077-402B-A208-2134A7476857}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 48 | {48509E81-7077-402B-A208-2134A7476857}.Debug|Any CPU.Build.0 = Debug|Any CPU 49 | {48509E81-7077-402B-A208-2134A7476857}.Release|Any CPU.ActiveCfg = Release|Any CPU 50 | {48509E81-7077-402B-A208-2134A7476857}.Release|Any CPU.Build.0 = Release|Any CPU 51 | {AF18E2B0-7ED3-4BDA-81BA-6A23B3C89F39}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 52 | {AF18E2B0-7ED3-4BDA-81BA-6A23B3C89F39}.Debug|Any CPU.Build.0 = Debug|Any CPU 53 | {AF18E2B0-7ED3-4BDA-81BA-6A23B3C89F39}.Release|Any CPU.ActiveCfg = Release|Any CPU 54 | {AF18E2B0-7ED3-4BDA-81BA-6A23B3C89F39}.Release|Any CPU.Build.0 = Release|Any CPU 55 | {FDD2C508-3201-4659-8962-886C2CBF41BD}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 56 | {FDD2C508-3201-4659-8962-886C2CBF41BD}.Debug|Any CPU.Build.0 = Debug|Any CPU 57 | {FDD2C508-3201-4659-8962-886C2CBF41BD}.Release|Any CPU.ActiveCfg = Release|Any CPU 58 | {FDD2C508-3201-4659-8962-886C2CBF41BD}.Release|Any CPU.Build.0 = Release|Any CPU 59 | {2AE59E5E-900D-5CCB-0C30-F8DFAD324C9E}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 60 | {2AE59E5E-900D-5CCB-0C30-F8DFAD324C9E}.Debug|Any CPU.Build.0 = Debug|Any CPU 61 | {2AE59E5E-900D-5CCB-0C30-F8DFAD324C9E}.Release|Any CPU.ActiveCfg = Release|Any CPU 62 | {2AE59E5E-900D-5CCB-0C30-F8DFAD324C9E}.Release|Any CPU.Build.0 = Release|Any CPU 63 | {8EC545BD-E076-A2DF-A7A4-2F11221AF297}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 64 | {8EC545BD-E076-A2DF-A7A4-2F11221AF297}.Debug|Any CPU.Build.0 = Debug|Any CPU 65 | {8EC545BD-E076-A2DF-A7A4-2F11221AF297}.Release|Any CPU.ActiveCfg = Release|Any CPU 66 | {8EC545BD-E076-A2DF-A7A4-2F11221AF297}.Release|Any CPU.Build.0 = Release|Any CPU 67 | {99600F69-5901-4CEA-8C54-BFDC0751E207}.Debug|Any CPU.ActiveCfg = Debug|Any CPU 68 | {99600F69-5901-4CEA-8C54-BFDC0751E207}.Debug|Any CPU.Build.0 = Debug|Any CPU 69 | {99600F69-5901-4CEA-8C54-BFDC0751E207}.Release|Any CPU.ActiveCfg = Release|Any CPU 70 | {99600F69-5901-4CEA-8C54-BFDC0751E207}.Release|Any CPU.Build.0 = Release|Any CPU 71 | EndGlobalSection 72 | GlobalSection(SolutionProperties) = preSolution 73 | HideSolutionNode = FALSE 74 | EndGlobalSection 75 | GlobalSection(ExtensibilityGlobals) = postSolution 76 | SolutionGuid = {D8F466EB-6501-49CC-94ED-77E9348E1831} 77 | EndGlobalSection 78 | EndGlobal 79 | -------------------------------------------------------------------------------- /breakdownchanges.md: -------------------------------------------------------------------------------- 1 | ### remove namespaces: 2 | - Lemon.ModuleNavigation.Avaloniaui.Extensions; 3 | - Lemon.ModuleNavigation.Avaloniaui.Dialogs; 4 | original members were pulled to Lemon.ModuleNavigation.Avaloniaui.Core; 5 | 6 | ### rename namespaces: 7 | - Lemon.ModuleNavigation.Abstracts to Lemon.ModuleNavigation.Abstractions; -------------------------------------------------------------------------------- /lemon-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverMorewd/Lemon.ModuleNavigation/7bab73f18a8a70db3b7686c45cd0aa1647d983dc/lemon-100.png -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Browser/Lemon.ModuleNavigation.Sample.Browser.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net8.0-browser 4 | Exe 5 | true 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Browser/Program.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Browser; 3 | using Avalonia.ReactiveUI; 4 | using Lemon.ModuleNavigation.Sample; 5 | using System.Runtime.Versioning; 6 | using System.Threading.Tasks; 7 | 8 | [assembly: SupportedOSPlatform("browser")] 9 | 10 | internal sealed partial class Program 11 | { 12 | private static Task Main(string[] args) => BuildAvaloniaApp() 13 | .WithInterFont() 14 | .UseReactiveUI() 15 | .StartBrowserAppAsync("out"); 16 | 17 | public static AppBuilder BuildAvaloniaApp() 18 | => AppBuilder.Configure(); 19 | } -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Browser/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Lemon.ModuleNavigation.Sample.Browser": { 4 | "commandName": "Project", 5 | "launchBrowser": true, 6 | "environmentVariables": { 7 | "ASPNETCORE_ENVIRONMENT": "Development" 8 | }, 9 | "applicationUrl": "https://localhost:9991;http://localhost:9990", 10 | "inspectUri": "{wsProtocol}://{url.hostname}:{url.port}/_framework/debug/ws-proxy?browser={browserInspectUri}" 11 | } 12 | } 13 | } -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Browser/runtimeconfig.template.json: -------------------------------------------------------------------------------- 1 | { 2 | "wasmHostProperties": { 3 | "perHostConfig": [ 4 | { 5 | "name": "browser", 6 | "html-path": "index.html", 7 | "Host": "browser" 8 | } 9 | ] 10 | } 11 | } -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Browser/wwwroot/app.css: -------------------------------------------------------------------------------- 1 | /* HTML styles for the splash screen */ 2 | .avalonia-splash { 3 | position: absolute; 4 | height: 100%; 5 | width: 100%; 6 | background: white; 7 | font-family: 'Outfit', sans-serif; 8 | justify-content: center; 9 | align-items: center; 10 | display: flex; 11 | pointer-events: none; 12 | } 13 | 14 | /* Light theme styles */ 15 | @media (prefers-color-scheme: light) { 16 | .avalonia-splash { 17 | background: white; 18 | } 19 | 20 | .avalonia-splash h2 { 21 | color: #1b2a4e; 22 | } 23 | 24 | .avalonia-splash a { 25 | color: #0D6EFD; 26 | } 27 | } 28 | 29 | @media (prefers-color-scheme: dark) { 30 | .avalonia-splash { 31 | background: #1b2a4e; 32 | } 33 | 34 | .avalonia-splash h2 { 35 | color: white; 36 | } 37 | 38 | .avalonia-splash a { 39 | color: white; 40 | } 41 | } 42 | 43 | .avalonia-splash h2 { 44 | font-weight: 400; 45 | font-size: 1.5rem; 46 | } 47 | 48 | .avalonia-splash a { 49 | text-decoration: none; 50 | font-size: 2.5rem; 51 | display: block; 52 | } 53 | 54 | .avalonia-splash.splash-close { 55 | transition: opacity 200ms, display 200ms; 56 | display: none; 57 | opacity: 0; 58 | } 59 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Browser/wwwroot/favicon.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverMorewd/Lemon.ModuleNavigation/7bab73f18a8a70db3b7686c45cd0aa1647d983dc/samples/Lemon.ModuleNavigation.Sample.Browser/wwwroot/favicon.ico -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Browser/wwwroot/main.js: -------------------------------------------------------------------------------- 1 | import { dotnet } from './_framework/dotnet.js' 2 | 3 | const is_browser = typeof window != "undefined"; 4 | if (!is_browser) throw new Error(`Expected to be running in a browser`); 5 | 6 | const dotnetRuntime = await dotnet 7 | .withDiagnosticTracing(false) 8 | .withApplicationArgumentsFromQuery() 9 | .create(); 10 | 11 | const config = dotnetRuntime.getConfig(); 12 | 13 | await dotnetRuntime.runMain(config.mainAssemblyName, [globalThis.location.href]); 14 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Desktop/Lemon.ModuleNavigation.Sample.Desktop.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WinExe 4 | 6 | net8.0 7 | enable 8 | true 9 | app.manifest 10 | 12 | 13 | 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Desktop/Program.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | using Avalonia; 3 | using Avalonia.ReactiveUI; 4 | 5 | namespace Lemon.ModuleNavigation.Sample.Desktop; 6 | 7 | public static class Program 8 | { 9 | [STAThread] 10 | public static void Main(string[] args) => BuildAvaloniaApp() 11 | .StartWithClassicDesktopLifetime(args); 12 | 13 | // Avalonia configuration, don't remove; also used by visual designer. 14 | private static AppBuilder BuildAvaloniaApp() 15 | => AppBuilder.Configure() 16 | .UsePlatformDetect() 17 | .WithInterFont() 18 | .LogToTrace() 19 | .UseReactiveUI(); 20 | } 21 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Desktop/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Lemon.ModuleNavigation.Sample.Desktop": { 4 | "commandName": "Project" 5 | }, 6 | "WSL": { 7 | "commandName": "WSL2", 8 | "distributionName": "" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.Desktop/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.DesktopHosting/Lemon.ModuleNavigation.Sample.DesktopHosting.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | WinExe 4 | 6 | net8.0 7 | enable 8 | true 9 | app.manifest 10 | 12 | 13 | 14 | true 15 | true 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.DesktopHosting/Program.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.ReactiveUI; 3 | using Lemon.Hosting.AvaloniauiDesktop; 4 | using Lemon.ModuleNavigation.Sample.ModuleAs; 5 | using Lemon.ModuleNavigation.Sample.ModuleBs; 6 | using Lemon.ModuleNavigation.Sample.ModuleCs; 7 | using Lemon.ModuleNavigation.Sample.ViewModels; 8 | using Lemon.ModuleNavigation.Sample.Views; 9 | using Lemon.ModuleNavigation.SampleViewModel; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using Microsoft.Extensions.Hosting; 12 | using Microsoft.Extensions.Logging; 13 | using System; 14 | using System.Runtime.Versioning; 15 | 16 | namespace Lemon.ModuleNavigation.Sample.DesktopHosting; 17 | 18 | internal static class Program 19 | { 20 | [STAThread] 21 | [SupportedOSPlatform("windows")] 22 | [SupportedOSPlatform("linux")] 23 | [SupportedOSPlatform("macos")] 24 | public static void Main(string[] args) 25 | { 26 | var hostBuilder = Host.CreateApplicationBuilder(); 27 | 28 | // module navigation 29 | hostBuilder.Services.AddAvaNavigationSupport(); 30 | hostBuilder.Logging.ClearProviders(); 31 | hostBuilder.Logging.AddConsole(); 32 | hostBuilder.Logging.SetMinimumLevel(LogLevel.Debug); 33 | // modules 34 | hostBuilder.Services.AddModule(); 35 | hostBuilder.Services.AddModule(); 36 | hostBuilder.Services.AddModule(); 37 | // views 38 | hostBuilder.Services.AddView(nameof(ViewAlpha)); 39 | hostBuilder.Services.AddView(nameof(ViewBeta)); 40 | hostBuilder.Services.AddAvaDialogWindow(nameof(CustomDialogWindow)); 41 | 42 | hostBuilder.Services.AddAvaloniauiDesktopApplication(BuildAvaloniaApp); 43 | hostBuilder.Services.AddMainWindow(); 44 | var appHost = hostBuilder.Build(); 45 | appHost.RunAvaloniauiApplication(args); 46 | } 47 | 48 | private static AppBuilder BuildAvaloniaApp(AppBuilder appBuilder) 49 | { 50 | return appBuilder 51 | .UsePlatformDetect() 52 | .WithInterFont() 53 | .LogToTrace() 54 | .UseReactiveUI(); 55 | } 56 | } 57 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.DesktopHosting/Properties/launchSettings.json: -------------------------------------------------------------------------------- 1 | { 2 | "profiles": { 3 | "Lemon.ModuleNavigation.Sample.DesktopHosting": { 4 | "commandName": "Project" 5 | }, 6 | "WSL": { 7 | "commandName": "WSL2", 8 | "distributionName": "" 9 | } 10 | } 11 | } -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.DesktopHosting/app.manifest: -------------------------------------------------------------------------------- 1 |  2 | 3 | 6 | 7 | 8 | 9 | 10 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample.DesktopHosting/rd.xml: -------------------------------------------------------------------------------- 1 |  2 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/App.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/App.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Markup.Xaml; 3 | 4 | namespace Lemon.ModuleNavigation.Sample; 5 | 6 | public partial class App : Application 7 | { 8 | public override void Initialize() 9 | { 10 | AvaloniaXamlLoader.Load(this); 11 | } 12 | 13 | } 14 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/AppWithDI.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Avalonia.Controls.ApplicationLifetimes; 3 | using Avalonia.Markup.Xaml; 4 | using Lemon.ModuleNavigation.Sample.ModuleAs; 5 | using Lemon.ModuleNavigation.Sample.ModuleBs; 6 | using Lemon.ModuleNavigation.Sample.ModuleCs; 7 | using Lemon.ModuleNavigation.Sample.ViewModels; 8 | using Lemon.ModuleNavigation.Sample.Views; 9 | using Lemon.ModuleNavigation.SampleViewModel; 10 | using Microsoft.Extensions.DependencyInjection; 11 | using System; 12 | 13 | namespace Lemon.ModuleNavigation.Sample; 14 | 15 | public partial class AppWithDi : Application 16 | { 17 | public IServiceProvider? AppServiceProvider { get; private set; } 18 | 19 | public override void Initialize() 20 | { 21 | AvaloniaXamlLoader.Load(this); 22 | } 23 | 24 | public override void OnFrameworkInitializationCompleted() 25 | { 26 | var services = new ServiceCollection(); 27 | services.AddLogging(); 28 | services.AddAvaNavigationSupport() 29 | .AddModule() 30 | .AddModule() 31 | .AddModule() 32 | .AddSingleton() 33 | .AddSingleton() 34 | .AddSingleton() 35 | .AddAvaDialogWindow(nameof(CustomDialogWindow)) 36 | .AddView(nameof(ViewAlpha)) 37 | .AddView(nameof(ViewBeta)); 38 | AppServiceProvider = services.BuildServiceProvider(); 39 | 40 | var viewModel = AppServiceProvider.GetRequiredService(); 41 | 42 | switch (ApplicationLifetime) 43 | { 44 | case IClassicDesktopStyleApplicationLifetime desktop: 45 | var window = AppServiceProvider.GetRequiredService(); 46 | window.DataContext = viewModel; 47 | desktop.MainWindow = window; 48 | break; 49 | case ISingleViewApplicationLifetime singleView: 50 | var view = AppServiceProvider.GetRequiredService(); 51 | view.DataContext = viewModel; 52 | singleView.MainView = view; 53 | break; 54 | } 55 | base.OnFrameworkInitializationCompleted(); 56 | } 57 | } 58 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/AppWithDi.axaml: -------------------------------------------------------------------------------- 1 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/Assets/avalonia-logo.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverMorewd/Lemon.ModuleNavigation/7bab73f18a8a70db3b7686c45cd0aa1647d983dc/samples/Lemon.ModuleNavigation.Sample/Assets/avalonia-logo.ico -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/Assets/lemon-100.ico: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverMorewd/Lemon.ModuleNavigation/7bab73f18a8a70db3b7686c45cd0aa1647d983dc/samples/Lemon.ModuleNavigation.Sample/Assets/lemon-100.ico -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/Assets/lemon-100.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverMorewd/Lemon.ModuleNavigation/7bab73f18a8a70db3b7686c45cd0aa1647d983dc/samples/Lemon.ModuleNavigation.Sample/Assets/lemon-100.png -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/Assets/lemon-28.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverMorewd/Lemon.ModuleNavigation/7bab73f18a8a70db3b7686c45cd0aa1647d983dc/samples/Lemon.ModuleNavigation.Sample/Assets/lemon-28.png -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/Assets/lemon-50.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/NeverMorewd/Lemon.ModuleNavigation/7bab73f18a8a70db3b7686c45cd0aa1647d983dc/samples/Lemon.ModuleNavigation.Sample/Assets/lemon-50.png -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/DesignDatas/MainWindowViewModel.cs: -------------------------------------------------------------------------------- 1 | using Avalonia; 2 | using Lemon.ModuleNavigation.Sample.ViewModels; 3 | using Microsoft.Extensions.DependencyInjection; 4 | 5 | namespace Lemon.ModuleNavigation.Sample.DesignDatas; 6 | 7 | public static class DesignData 8 | { 9 | public static MainViewModel MainWindowViewModel { get; } = 10 | ((AppWithDi)Application.Current!).AppServiceProvider!.GetRequiredService(); 11 | } 12 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/DialogWindows/CustomDialogWindow.axaml: -------------------------------------------------------------------------------- 1 | 8 | Welcome to Avalonia! 9 | 10 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/DialogWindows/CustomDialogWindow.axaml.cs: -------------------------------------------------------------------------------- 1 | using Avalonia.Controls; 2 | using Lemon.ModuleNavigation.Avaloniaui; 3 | 4 | namespace Lemon.ModuleNavigation.Sample; 5 | 6 | public partial class CustomDialogWindow : Window, IDialogWindow 7 | { 8 | public CustomDialogWindow() 9 | { 10 | InitializeComponent(); 11 | } 12 | } -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/Lemon.ModuleNavigation.Sample.csproj: -------------------------------------------------------------------------------- 1 |  2 | 3 | net8.0 4 | enable 5 | latest 6 | Assets\avalonia-logo.ico 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | 20 | 21 | 22 | 23 | 24 | 25 | 26 | 27 | 28 | 29 | 30 | 31 | 32 | 33 | 34 | 35 | 36 | 37 | 38 | 39 | 40 | 41 | 42 | SubView01.axaml 43 | 44 | 45 | 46 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/ModuleAs/ModuleA.cs: -------------------------------------------------------------------------------- 1 | using System; 2 | 3 | namespace Lemon.ModuleNavigation.Sample.ModuleAs; 4 | 5 | public class ModuleA : Module 6 | { 7 | public ModuleA(IServiceProvider serviceProvider) : base(serviceProvider) 8 | { 9 | 10 | } 11 | 12 | /// 13 | /// Specifies whether this module needs to be loaded on demand 14 | /// Default value is True 15 | /// 16 | public override bool LoadOnDemand => false; 17 | 18 | /// 19 | /// Alias of module for displaying usually 20 | /// Default value is class name of Module 21 | /// 22 | public override string? Alias => base.Alias; 23 | 24 | /// 25 | /// Specifies whether this module allow multiple instances 26 | /// If true,every navigation to this module will generate a new instance. 27 | /// Default value is false. 28 | /// 29 | public override bool ForceNew => base.ForceNew; 30 | 31 | /// 32 | /// Specifies whether this module can be unloaded. 33 | /// Default value is false. 34 | /// 35 | public override bool CanUnload => base.CanUnload; 36 | 37 | /// 38 | /// Initialize 39 | /// 40 | public override void Initialize() 41 | { 42 | base.Initialize(); 43 | } 44 | } 45 | -------------------------------------------------------------------------------- /samples/Lemon.ModuleNavigation.Sample/ModuleAs/ViewA.axaml: -------------------------------------------------------------------------------- 1 | 7 | 8 | 9 |