Mvvm.Navigation.Uno.WinUI
                               
                            
                                1.2.7
                            
                        
                    See the version list below for details.
dotnet add package Mvvm.Navigation.Uno.WinUI --version 1.2.7
NuGet\Install-Package Mvvm.Navigation.Uno.WinUI -Version 1.2.7
<PackageReference Include="Mvvm.Navigation.Uno.WinUI" Version="1.2.7" />
<PackageVersion Include="Mvvm.Navigation.Uno.WinUI" Version="1.2.7" />
<PackageReference Include="Mvvm.Navigation.Uno.WinUI" />
paket add Mvvm.Navigation.Uno.WinUI --version 1.2.7
#r "nuget: Mvvm.Navigation.Uno.WinUI, 1.2.7"
#:package Mvvm.Navigation.Uno.WinUI@1.2.7
#addin nuget:?package=Mvvm.Navigation.Uno.WinUI&version=1.2.7
#tool nuget:?package=Mvvm.Navigation.Uno.WinUI&version=1.2.7
Mvvm.Navigation
Provides platform independent navigation at the MVVM level and a Source Generator that automatically binds view and view models and registers this in your DI container.
🔥Features🔥
- Uses DI to resolve your view from view model.
 - Generates an extension method for you with all your Views and ViewModels to register them in DI.
 - Does not contain custom controls, everything happens based on the attached dependency property and does not limit the user.
 - Allows forward/backward navigation like in Chrome.
 - Allows you to receive activation/deactivation events - just implement IActivatableViewModel for your ViewModel.
 - Allows you to generate a typed ViewModel property via an attribute, bound to your BindingContext and initialized from DI.
 - Supports automatic mapping between View and ViewModel based on a global attribute.
 - Allows case-by-case, attribute-based control for Views.
 
Usage
- Add 
.AddMvvmNavigation()call to your Host builder orIServiceCollection: 
public sealed partial class App
{
    public App()
    {
        AppHost = Host
            .CreateDefaultBuilder()
            .AddMvvmNavigation()
            .Build();
    }
}
- Add ViewFor attribute to your views:
 
using Mvvm.Navigation;
[ViewFor<MainViewModel>]
public partial class MainPage : UserControl;
or assembly level attribute(nameof behavior is ignored and the full namespace is taken):
[assembly:MapViews(
    viewsNamespace: nameof(MyNamespace.Views),
    viewModelsNamespace: nameof(MyNamespace.ViewModels))]
- Add Navigator to your ViewModel:
 
public Navigator<ObservableObject> Navigator { get; }
- Add commands to your views(or just use Navigator from ViewModel):
 
<Grid>
    <Button
        Command="{Binding Navigator.NavigateByTypeCommand}"
        CommandParameter="{x:Type viewModels:BlueViewModel}"
        />
    <ContentControl mvvm:Properties.Navigator="{Binding Navigator}"/>
</Grid>
Tip: you can use CommandParameter="{mvvm:Type Type=viewModels:BlueViewModel}" for WinUI/UWP/Uno platforms.
Base
The library was written as a replacement for ReactiveUI in a real project,
and inherits some concepts from it, excluding reactivity.
If you have the same task, then the changes are as follows:
- Replace RoutingState with Navigator
 - Replace IScreen with INavigable
 - Replace ReactiveUserControl with UserControl
 - Replace ReactiveWindow with Window
 - Replace RoutedViewHost and ViewModelViewHost with ContentControl
 - Use 
mvvm:Properties.ViewModelandmvvm:Properties.Resolver/mvvm:Properties.Navigator(includes resolver) attached dependency properties. 
Support
Priority place for bugs: https://github.com/HavenDV/Mvvm.Navigation/issues
Priority place for ideas and general questions: https://github.com/HavenDV/Mvvm.Navigation/discussions
I also have a Discord support channel:
https://discord.gg/g8u2t9dKgE
| Product | Versions Compatible and additional computed target framework versions. | 
|---|---|
| .NET | net7.0 is compatible. net7.0-android was computed. net7.0-android33.0 is compatible. net7.0-ios was computed. net7.0-ios16.1 is compatible. net7.0-maccatalyst was computed. net7.0-maccatalyst16.1 is compatible. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. net7.0-windows10.0.19041 is compatible. net8.0 was computed. net8.0-android was computed. net8.0-browser was computed. net8.0-ios was computed. net8.0-maccatalyst was computed. net8.0-macos was computed. net8.0-tvos was computed. net8.0-windows was computed. net9.0 was computed. net9.0-android was computed. net9.0-browser was computed. net9.0-ios was computed. net9.0-maccatalyst was computed. net9.0-macos was computed. net9.0-tvos was computed. net9.0-windows was computed. net10.0 was computed. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. | 
- 
                                                    
net7.0
- Mvvm.Navigation.Core (>= 1.2.7)
 - Uno.WinUI (>= 4.10.13)
 
 - 
                                                    
net7.0-android33.0
- Mvvm.Navigation.Core (>= 1.2.7)
 - Uno.WinUI (>= 4.10.13)
 
 - 
                                                    
net7.0-ios16.1
- Mvvm.Navigation.Core (>= 1.2.7)
 - Uno.WinUI (>= 4.10.13)
 
 - 
                                                    
net7.0-maccatalyst16.1
- Mvvm.Navigation.Core (>= 1.2.7)
 - Uno.WinUI (>= 4.10.13)
 
 - 
                                                    
net7.0-windows10.0.19041
- Mvvm.Navigation.Core (>= 1.2.7)
 - Uno.WinUI (>= 4.10.13)
 
 
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated | 
|---|---|---|
| 1.5.1 | 230 | 3/5/2024 | 
| 1.5.0 | 185 | 3/4/2024 | 
| 1.4.5 | 263 | 12/4/2023 | 
| 1.4.4 | 201 | 12/4/2023 | 
| 1.4.3 | 189 | 12/4/2023 | 
| 1.4.1 | 156 | 12/3/2023 | 
| 1.4.0 | 184 | 12/3/2023 | 
| 1.3.0 | 174 | 12/1/2023 | 
| 1.2.7 | 413 | 9/22/2023 | 
| 1.2.6 | 237 | 9/22/2023 | 
| 1.2.5 | 235 | 9/21/2023 | 
| 1.2.4 | 227 | 9/16/2023 | 
| 1.2.3 | 241 | 9/16/2023 | 
| 1.2.2 | 268 | 9/14/2023 | 
| 1.2.1 | 262 | 9/14/2023 | 
| 1.2.0 | 237 | 9/14/2023 | 
| 1.1.3 | 271 | 9/11/2023 | 
| 1.1.2 | 253 | 9/11/2023 | 
| 1.1.1 | 274 | 9/7/2023 | 
| 1.1.0 | 313 | 9/5/2023 | 
| 1.0.1 | 293 | 9/4/2023 | 
| 1.0.0 | 296 | 9/3/2023 | 
| 0.2.0 | 302 | 9/3/2023 | 
| 0.1.0 | 294 | 9/2/2023 | 
⭐ Last 10 features:
- feat: Added BeforeInitializeComponent/AfterInitializeComponent partial methods when generating constructors. Fixed ViewModel init order. 2023-09-14
- feat: Now you can implement IActivatable for window/control and it will work. 2023-09-14
- feat: Implemented assembly:MapViews attribute. 2023-09-05
- feat: Added Activation support. 2023-09-04
- feat: Added separate property for InitializeComponent constructor. 2023-09-03
- feat: Released 0.2.0. 2023-09-03
- feat: Added Type markup extension. 2023-09-03
- feat: Added Properties.ViewModelType. 2023-09-02
- feat: Added HostApplicationBuilderExtensions. 2023-09-02
- feat: Removed Ioc.Default from main code. 2023-09-02
🐞 Last 10 bug fixes:
- fix: Fixed work of ServiceLifetime.None. 2023-09-22
- fix: Fixed ViewLifetime/ViewModelLifetime. 2023-09-22
- fix: Fixed ViewModel/ViewModelType default binding mode. 2023-09-22
- fix: Removed views with ViewFor attribute from MapViews generation. Closes #6. 2023-09-17
- fix: Fixed issue with combined MapViews and ViewFor. 2023-09-16
- fix: Added try to resolve IResolver from Ioc.Default. 2023-09-15
- fix: Fixed ambiguities with resolver. 2023-09-14
- fix: Generated ViewModel property can be null now. 2023-09-12
- fix: Fixed problems with DependencyPropertyGenerator. 2023-09-11
- fix: Fixed "An expression is too long or complex to compile" in big projects. 2023-09-07