Dreamine.MVVM.Locators.Wpf
1.0.6
dotnet add package Dreamine.MVVM.Locators.Wpf --version 1.0.6
NuGet\Install-Package Dreamine.MVVM.Locators.Wpf -Version 1.0.6
<PackageReference Include="Dreamine.MVVM.Locators.Wpf" Version="1.0.6" />
<PackageVersion Include="Dreamine.MVVM.Locators.Wpf" Version="1.0.6" />
<PackageReference Include="Dreamine.MVVM.Locators.Wpf" />
paket add Dreamine.MVVM.Locators.Wpf --version 1.0.6
#r "nuget: Dreamine.MVVM.Locators.Wpf, 1.0.6"
#:package Dreamine.MVVM.Locators.Wpf@1.0.6
#addin nuget:?package=Dreamine.MVVM.Locators.Wpf&version=1.0.6
#tool nuget:?package=Dreamine.MVVM.Locators.Wpf&version=1.0.6
Dreamine.MVVM.Locators.Wpf
WPF integration layer for the Dreamine MVVM locator system.
This package extends Dreamine.MVVM.Locators with WPF-specific runtime helpers for:
- automatic View ↔ ViewModel binding
- View resolution from ViewModel instances
- region-based content navigation
ContentControl-based navigation hosting
It is designed for WPF applications that want lightweight locator-based composition without introducing a heavy framework.
Purpose
Dreamine.MVVM.Locators.Wpf provides the WPF runtime bridge between:
Dreamine.MVVM.Locators- WPF
FrameworkElement - XAML attached properties
- region/content navigation patterns
This package is responsible for connecting Views and ViewModels at runtime in a WPF-friendly way.
Key Components
ViewModelBinder
WPF attached-property helper for automatic ViewModel wiring.
Responsibilities:
- exposes
AutoWireViewModelattached property - resolves ViewModel by using
ViewModelLocator.Resolve(view.GetType()) - assigns resolved ViewModel to
DataContext - resolves View instances from ViewModel instances using naming conventions
Example:
<Window
xmlns:locator="clr-namespace:Dreamine.MVVM.Locators.Wpf"
locator:ViewModelBinder.AutoWireViewModel="True">
</Window>
RegionBinder
Attached-property-based region registry for ContentControl.
Responsibilities:
- registers
ContentControlinstances by region name - navigates by region key
- resolves View from ViewModel through
ViewModelBinder.ResolveView
Example:
<ContentControl
local:RegionBinder.RegionName="MainRegion" />
RegionBinder.Navigate("MainRegion", viewModel);
ContentControlNavigator
Simple INavigator implementation for ContentControl.
Responsibilities:
- resolves a View from a ViewModel
- assigns the resolved View to
ContentControl.Content
Example:
var navigator = new ContentControlNavigator(MainContentControl);
navigator.Navigate(viewModel);
View Resolution Rules
ViewModelBinder.ResolveView(object viewModel) tries multiple naming patterns.
Examples of supported conversions include:
ViewModels→ViewsViewModel→ViewViewModel→ empty stringViewModels→PagesPageModels→PagesPageModel→Page
This allows the package to work with several WPF naming styles.
Requirements
- .NET 8.0
- WPF enabled
- Reference to
Dreamine.MVVM.Locators
Installation
dotnet add package Dreamine.MVVM.Locators.Wpf
Or add it directly to your project file:
<PackageReference Include="Dreamine.MVVM.Locators.Wpf" Version="1.0.3" />
Architecture Role
This package belongs to the WPF integration layer of the Dreamine MVVM stack.
Dreamine.MVVM.Locators
↓
Dreamine.MVVM.Locators.Wpf
↓
WPF Views / Regions / Navigation
When to Use
Use this package when:
- you are building a WPF application with Dreamine MVVM
- you want automatic ViewModel binding from XAML
- you want to resolve a View from a ViewModel dynamically
- you need lightweight region/content navigation without a large framework
Do not use this package outside WPF.
License
MIT License
| 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. |
-
net8.0-windows7.0
- Dreamine.MVVM.Interfaces (>= 1.0.6)
- Dreamine.MVVM.Locators (>= 1.0.8)
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Dreamine.MVVM.Locators.Wpf:
| Package | Downloads |
|---|---|
|
Dreamine.MVVM.Extensions
Common extension utilities for Dreamine MVVM, including LINQ, ICommand, and observable helpers. |
|
|
Dreamine.MVVM.FullKit
All-in-one package for Dreamine MVVM on WPF. Includes core MVVM modules and automatic source generator integration. |
|
|
Dreamine.MVVM.Wpf
WPF-specific bootstrap and runtime integration layer for the Dreamine MVVM framework. |
GitHub repositories
This package is not used by any popular GitHub repositories.