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
<PackageReference Include="RJi.Mvvm.Wpf" Version="2.2.0" />
<PackageVersion Include="RJi.Mvvm.Wpf" Version="2.2.0" />
<PackageReference Include="RJi.Mvvm.Wpf" />
paket add RJi.Mvvm.Wpf --version 2.2.0
#r "nuget: RJi.Mvvm.Wpf, 2.2.0"
#:package RJi.Mvvm.Wpf@2.2.0
#addin nuget:?package=RJi.Mvvm.Wpf&version=2.2.0
#tool nuget:?package=RJi.Mvvm.Wpf&version=2.2.0
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.), singleAddGeneratedRegistrations()call - Single-Page Navigation —
UserControlinsideContentControlzones with lifecycle, history, and view caching - Dialog Windows — Built-in DialogWindow with lifecycle hooks, custom window support
- DI Container —
IServiceCollection-based, 12 DI attributes covering all lifetimes - Navigation Service — Zone registry, navigation confirmation (callback pattern), ViewModel locator
- UI Thread Dispatching —
IUIDispatcherinterface for safe background-to-UI thread operations
| Product | Versions 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. |
-
.NETFramework 4.8
- CommunityToolkit.Mvvm (>= 8.2.2)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
-
net8.0-windows7.0
- CommunityToolkit.Mvvm (>= 8.2.2)
- Microsoft.Extensions.DependencyInjection (>= 8.0.1)
NuGet packages
This package is not used by any NuGet packages.
GitHub repositories
This package is not used by any popular GitHub repositories.
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