RJi.Mvvm.Wpf 2.2.0

dotnet add package RJi.Mvvm.Wpf --version 2.2.0
                    
NuGet\Install-Package RJi.Mvvm.Wpf -Version 2.2.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="RJi.Mvvm.Wpf" Version="2.2.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="RJi.Mvvm.Wpf" Version="2.2.0" />
                    
Directory.Packages.props
<PackageReference Include="RJi.Mvvm.Wpf" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add RJi.Mvvm.Wpf --version 2.2.0
                    
#r "nuget: RJi.Mvvm.Wpf, 2.2.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package RJi.Mvvm.Wpf@2.2.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=RJi.Mvvm.Wpf&version=2.2.0
                    
Install as a Cake Addin
#tool nuget:?package=RJi.Mvvm.Wpf&version=2.2.0
                    
Install as a Cake Tool

RJi.Mvvm.Wpf

A WPF MVVM framework built on CommunityToolkit.Mvvm and Microsoft.Extensions.DependencyInjection (.NET 8 / .NET Framework 4.8), designed for single-page navigation in small-to-medium projects.

⚠️ .NET Framework 4.8: Source generators require SDK-style project (Microsoft.NET.Sdk) with <LangVersion>latest</LangVersion>. See the full docs for migration steps.

The primary use case is industrial automation (工控) development. The navigation model is based on ContentControl zone switching — each zone displays one view at a time, supporting both full-page transitions and fixed-layout page switching. It does not adopt a multi-region caching architecture (where each region maintains its own independent view stack); instead, the navigation service manages a flat view stack with optional view caching per zone, keeping the mental model simple and predictable for scaffold-style projects.

  • MVVM Foundation — ObservableObject, RelayCommand, Messenger with automatic UI thread dispatch
  • Zero Reflection — Explicit View–ViewModel binding via generic methods at startup
  • Source Generators — CT.Mvvm ([ObservableProperty], [RelayCommand]) + framework ([NavigationTarget], [AddSingleton], [ViewModelLocator], etc.), single AddGeneratedRegistrations() call
  • Single-Page NavigationUserControl inside ContentControl zones with lifecycle, history, and view caching
  • Dialog Windows — Built-in DialogWindow with lifecycle hooks, custom window support
  • DI ContainerIServiceCollection-based, 12 DI attributes covering all lifetimes
  • Navigation Service — Zone registry, navigation confirmation (callback pattern), ViewModel locator
  • UI Thread DispatchingIUIDispatcher interface for safe background-to-UI thread operations

Full Documentation (English) | 完整文档 (中文)

Product Compatible and additional computed target framework versions.
.NET net8.0-windows7.0 is compatible.  net9.0-windows was computed.  net10.0-windows was computed. 
.NET Framework net48 is compatible.  net481 was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

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
2.2.0 118 6/3/2026
2.1.1 129 6/1/2026
1.2.8 160 5/27/2026
1.2.7 152 4/13/2026 1.2.7 is deprecated because it is no longer maintained.
Loading failed

2.2.0

Breaking changes:
• Removed IConfirmNavigationRequest.CanClose() — use ConfirmNavigationRequest only
• Removed Conductor/IChildLifecycle — replaced by Messenger/Navigation Parameters

New:
• DispatcherMessenger UIThread mode now uses InvokeAsync (aligned with Prism), no longer swallows exceptions
• ParameterCollection consolidated to Mvvm/Internal, removed duplicate from Dialogs

Fixes:
• ViewZoneRegistry.Contains no longer returns stale data for GC'd WeakReference entries
• DialogService no longer throws NullReferenceException when DataContext is null
• MessengerToken.GetHashCode non-zero to avoid dictionary hash collisions
• RJiApplication.ServiceProvider returns null after disposal instead of disposed container
• ViewZone internals use IDispatcherMessenger instead of IMessenger directly