Dreamine.MVVM.Interfaces
1.0.6
dotnet add package Dreamine.MVVM.Interfaces --version 1.0.6
NuGet\Install-Package Dreamine.MVVM.Interfaces -Version 1.0.6
<PackageReference Include="Dreamine.MVVM.Interfaces" Version="1.0.6" />
<PackageVersion Include="Dreamine.MVVM.Interfaces" Version="1.0.6" />
<PackageReference Include="Dreamine.MVVM.Interfaces" />
paket add Dreamine.MVVM.Interfaces --version 1.0.6
#r "nuget: Dreamine.MVVM.Interfaces, 1.0.6"
#:package Dreamine.MVVM.Interfaces@1.0.6
#addin nuget:?package=Dreamine.MVVM.Interfaces&version=1.0.6
#tool nuget:?package=Dreamine.MVVM.Interfaces&version=1.0.6
Dreamine.MVVM.Interfaces
Dreamine.MVVM.Interfaces defines shared abstraction contracts used across the Dreamine MVVM framework.
This package contains contracts only. It does not provide concrete dependency injection containers, WPF navigation implementations, ViewModel locators, or runtime object creation logic.
The purpose of this package is to keep Dreamine modules loosely coupled and to preserve clean dependency direction between framework layers.
What this library provides
Dreamine.MVVM.Interfaces provides contracts for:
- dependency registration
- dependency resolution
- service container composition
- constructor selection
- object activation
- assembly type scanning
- auto-registration
- ViewModel resolution
- navigation
- event base markers
Package Role
Dreamine.MVVM.Interfaces should remain the lowest-level shared contract package.
Recommended dependency direction:
Dreamine.MVVM.Interfaces
↑
Dreamine.MVVM.Core
↑
Dreamine.MVVM.Locators / Dreamine.MVVM.Wpf / Application modules
Rules:
Dreamine.MVVM.Interfacesmust not depend onDreamine.MVVM.Core.Dreamine.MVVM.Interfacesmust not depend on WPF-specific packages.- Implementations should live in higher-level packages.
- Consumers should depend on the smallest interface they need.
Project Structure
Dreamine.MVVM.Interfaces
├── DependencyInjection
│ ├── IAssemblyTypeScanner.cs
│ ├── IAutoRegistrationService.cs
│ ├── IConstructorSelector.cs
│ ├── IObjectActivator.cs
│ ├── IServiceContainer.cs
│ ├── IServiceRegistry.cs
│ └── IServiceResolver.cs
├── Events
│ └── IEventBase.cs
├── Locators
│ └── IViewModelResolver.cs
└── Navigation
└── INavigator.cs
Dependency Injection Contracts
IServiceRegistry
Defines service registration operations.
Supported registration concepts:
- transient concrete registration
- transient abstraction-to-implementation registration
- factory registration
- singleton instance registration
- singleton concrete registration
- singleton abstraction-to-implementation registration
- registration existence checks
Example implementation usage:
registry.Register<IMyService, MyService>();
registry.RegisterSingleton<ISharedState, SharedState>();
IServiceResolver
Defines service resolution operations.
TService service = resolver.Resolve<TService>();
object service = resolver.Resolve(typeof(TService));
IServiceContainer
Combines IServiceRegistry and IServiceResolver.
Use this only when a component genuinely needs both registration and resolution capabilities.
For better interface segregation:
- depend on
IServiceRegistrywhen only registration is needed - depend on
IServiceResolverwhen only resolution is needed
IConstructorSelector
Selects the constructor used during object activation.
Concrete implementations may choose constructors by policy, for example:
- largest parameter count
- explicit attribute
- parameter resolvability
IObjectActivator
Creates object instances using constructor injection.
It receives an IServiceResolver so constructor dependencies can be resolved without directly depending on a concrete container.
IAssemblyTypeScanner
Scans assemblies and returns loadable types.
This allows implementations to safely handle partially loadable assemblies and ReflectionTypeLoadException scenarios.
IAutoRegistrationService
Defines the contract for convention-based auto-registration.
Concrete implementations decide:
- which assemblies are scanned
- which types are eligible
- which lifetime policy is applied
Locator Contract
IViewModelResolver
Defines a minimal ViewModel resolution strategy.
object? viewModel = resolver.Resolve(typeof(MainWindowViewModel));
Typical implementers:
- DI-backed ViewModel resolver
- manual factory resolver
- test resolver
Navigation Contract
INavigator
Defines the minimal navigation contract used by Dreamine navigation implementations.
navigator.Navigate(viewModel);
INavigator intentionally accepts an object ViewModel to keep the contract independent from WPF UI types. Concrete navigation behavior belongs to WPF-specific packages.
Event Contract
IEventBase
Marker interface for Dreamine event classes.
It can be used by source generators, scanners, or framework conventions to identify event objects without introducing concrete dependencies.
Design Goals
Dreamine.MVVM.Interfaces prioritizes:
- dependency inversion
- interface segregation
- low coupling between modules
- testable infrastructure boundaries
- UI-framework independence
- replaceable implementations
- stable contracts for Core, Locators, WPF, and application modules
Requirements
- .NET:
net8.0 - No WPF dependency
- No concrete runtime implementation dependency
Installation
dotnet add package Dreamine.MVVM.Interfaces
Or add to your project file:
<ItemGroup>
<PackageReference Include="Dreamine.MVVM.Interfaces" Version="1.0.4" />
</ItemGroup>
Related Modules
Typical implementations and consumers:
Dreamine.MVVM.CoreDreamine.MVVM.LocatorsDreamine.MVVM.Locators.WpfDreamine.MVVM.WpfDreamine.MVVM.Behaviors.CoreDreamine.MVVM.Behaviors.Wpf
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net8.0 is compatible. 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. |
-
net8.0
- No dependencies.
NuGet packages (3)
Showing the top 3 NuGet packages that depend on Dreamine.MVVM.Interfaces:
| Package | Downloads |
|---|---|
|
Dreamine.MVVM.Locators
Registration and resolution helpers for ViewModels and services in Dreamine MVVM. |
|
|
Dreamine.MVVM.Locators.Wpf
WPF-specific locator components for automatic View-to-ViewModel wiring and dependency injection in Dreamine MVVM. |
|
|
Dreamine.MVVM.FullKit
All-in-one package for Dreamine MVVM on WPF. Includes core MVVM modules and automatic source generator integration. |
GitHub repositories
This package is not used by any popular GitHub repositories.