Dreamine.MVVM.Attributes
1.0.7
dotnet add package Dreamine.MVVM.Attributes --version 1.0.7
NuGet\Install-Package Dreamine.MVVM.Attributes -Version 1.0.7
<PackageReference Include="Dreamine.MVVM.Attributes" Version="1.0.7" />
<PackageVersion Include="Dreamine.MVVM.Attributes" Version="1.0.7" />
<PackageReference Include="Dreamine.MVVM.Attributes" />
paket add Dreamine.MVVM.Attributes --version 1.0.7
#r "nuget: Dreamine.MVVM.Attributes, 1.0.7"
#:package Dreamine.MVVM.Attributes@1.0.7
#addin nuget:?package=Dreamine.MVVM.Attributes&version=1.0.7
#tool nuget:?package=Dreamine.MVVM.Attributes&version=1.0.7
Dreamine.MVVM.Attributes
Dreamine.MVVM.Attributes is a lightweight attribute library used by the Dreamine MVVM ecosystem.
This package does not implement MVVM behavior by itself.
Instead, it provides declarative markers consumed by Dreamine tooling such as source generators and supporting runtime modules.
It is designed to reduce repetitive ViewModel code while keeping the codebase explicit, readable, and maintainable.
What this library solves
In MVVM projects, repetitive patterns appear frequently:
- private field → public property generation
- method → command property generation
- ViewModel ↔ Model proxy mapping
- entry type or structural role marking
- command methods that forward calls to event/service targets
This package standardizes those patterns through attributes only, so higher-level Dreamine tooling can generate the required code consistently.
Key Features
- Attribute-only package with a low dependency footprint
- Designed for Dreamine MVVM source-generation workflows
- Supports property generation markers
- Supports command generation markers
- Supports entry/model/event structural markers
- Supports ViewModel → Model proxy property mapping
- Targets
netstandard2.0for broad compatibility
Requirements
- Target Framework:
netstandard2.0 - Typically used together with:
- Dreamine MVVM generator packages
- Dreamine MVVM runtime/core packages
- WPF or other .NET desktop MVVM projects
Installation
Option A) NuGet
dotnet add package Dreamine.MVVM.Attributes
Option B) PackageReference
<ItemGroup>
<PackageReference Include="Dreamine.MVVM.Attributes" Version="1.0.4" />
</ItemGroup>
Project Structure
Dreamine.MVVM.Attributes
├── DreamineCommandAttribute.cs
├── DreamineEntryAttribute.cs
├── DreamineEventAttribute.cs
├── DreamineModelAttribute.cs
├── DreamineModelPropertyAttribute.cs
└── DreaminePropertyAttribute.cs
Architecture Role
This package belongs to the declaration layer of the Dreamine MVVM stack.
ViewModel Source Code
│
├─ Dreamine.MVVM.Attributes
│ (markers / metadata)
│
├─ Dreamine Generator
│ (code generation)
│
└─ Dreamine Runtime/Core
(execution / MVVM infrastructure)
The attributes declare intent, while other Dreamine packages implement the actual behavior.
This separation helps keep responsibilities clear:
- Attributes describe metadata only
- Generators produce code from that metadata
- Runtime packages execute the generated behavior
Quick Start
1) Property generation marker
using Dreamine.MVVM.Attributes;
public partial class MainViewModel
{
[DreamineProperty]
private string _title;
}
Typical intent:
- field-based declaration
- generated public property
- property change notification handled by generator/runtime
2) Command generation marker
using Dreamine.MVVM.Attributes;
public partial class MainViewModel
{
[DreamineCommand]
private void Save()
{
}
}
Typical intent:
- method marked as command source
- command property generated automatically
- command naming defaults to
{MethodName}Command
3) Entry marker
using Dreamine.MVVM.Attributes;
[DreamineEntry]
public partial class App
{
}
Typical intent:
- marks an application entry or bootstrap type
- useful for discovery/bootstrap scenarios
- makes the intended entry role explicit to Dreamine tooling
4) Model proxy mapping marker
using Dreamine.MVVM.Attributes;
public partial class MainViewModel
{
[DreamineModelProperty]
private string _readme;
}
Typical intent:
- bind a ViewModel field to a Model property proxy
- generator maps the property to
Model.Readmeor a specified model property
5) Forwarding command marker
using Dreamine.MVVM.Attributes;
public partial class MainViewModel
{
[DreamineCommand("Event.ReadmeClick", BindTo = "Readme")]
partial void LoadReadme();
}
Typical intent:
- generate a command that invokes a target method path
- support target paths such as
Event.*orService.* - optionally assign the returned value to a property via
BindTo
Attribute Reference
DreaminePropertyAttribute
Marks a field for generated property creation.
[DreamineProperty]
private string _name;
Optional parameter:
propertyName: explicitly overrides the generated property name
DreamineCommandAttribute
Marks a method for generated command creation.
Use it without constructor arguments when the generated command should execute the annotated method directly.
[DreamineCommand]
private void Save()
{
}
Use it with TargetMethod when the generated command should forward execution to another target path.
[DreamineCommand("Service.Load", BindTo = "Result")]
partial void Load();
Members:
TargetMethod: target method pathBindTo: optional property that receives the return valueCommandName: optional explicit command property name
DreamineCommandAttribute replaces the old relay-command marker surface so users only need one command-generation marker.
DreamineEntryAttribute
Marks a class as an entry or bootstrap type.
[DreamineEntry]
public partial class App
{
}
Useful for:
- startup discovery
- generator scanning rules
- explicit architectural intent
DreamineModelAttribute
Marks a class or field as part of the model-related structure.
[DreamineModel]
private MainModel _model;
Typical interpretation:
- on a class: identifies the type as model-related metadata
- on a field: identifies a model-related member for generation or interpretation
Optional parameter:
propertyName: explicit generated property name
DreamineEventAttribute
Marks a class or field as part of the event-related structure.
[DreamineEvent]
private MainEvent _event;
Typical interpretation:
- on a class: identifies the type as event-related metadata
- on a field: identifies an event-related member for generation or interpretation
Optional parameter:
propertyName: explicit generated property name
DreamineModelPropertyAttribute
Maps a ViewModel field to a Model property proxy.
[DreamineModelProperty("Readme")]
private string _readme;
Optional parameter:
modelPropertyName: explicit model property name
Design Notes
This package intentionally keeps the attribute layer small and dependency-free.
That means:
- no MVVM runtime logic inside the package
- no command implementation inside the package
- no property notification implementation inside the package
- only metadata and declaration markers
This separation aligns well with the overall architectural goal of keeping responsibilities isolated:
- the attribute package focuses on declaration only
- generators can evolve independently
- runtime behavior stays outside the declaration layer
Comparison
| Package | Role | Runtime Logic | Code Generation Markers |
|---|---|---|---|
| CommunityToolkit.Mvvm | MVVM toolkit | Yes | Yes |
| Prism | MVVM framework | Yes | No |
| Dreamine.MVVM.Attributes | Attribute declarations | No | Yes |
Dreamine.MVVM.Attributes is intentionally focused on the declaration layer, not the full runtime framework.
Recommended Package Pairing
This package is most useful when combined with:
Dreamine.MVVM.Core
Dreamine.MVVM.Generators
Dreamine runtime / UI packages
By itself, this package mainly defines metadata for higher-level Dreamine tooling.
License
MIT License
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net5.0 was computed. net5.0-windows was computed. net6.0 was computed. net6.0-android was computed. net6.0-ios was computed. net6.0-maccatalyst was computed. net6.0-macos was computed. net6.0-tvos was computed. net6.0-windows was computed. net7.0 was computed. net7.0-android was computed. net7.0-ios was computed. net7.0-maccatalyst was computed. net7.0-macos was computed. net7.0-tvos was computed. net7.0-windows was computed. 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. |
| .NET Core | netcoreapp2.0 was computed. netcoreapp2.1 was computed. netcoreapp2.2 was computed. netcoreapp3.0 was computed. netcoreapp3.1 was computed. |
| .NET Standard | netstandard2.0 is compatible. netstandard2.1 was computed. |
| .NET Framework | net461 was computed. net462 was computed. net463 was computed. net47 was computed. net471 was computed. net472 was computed. net48 was computed. net481 was computed. |
| MonoAndroid | monoandroid was computed. |
| MonoMac | monomac was computed. |
| MonoTouch | monotouch was computed. |
| Tizen | tizen40 was computed. tizen60 was computed. |
| Xamarin.iOS | xamarinios was computed. |
| Xamarin.Mac | xamarinmac was computed. |
| Xamarin.TVOS | xamarintvos was computed. |
| Xamarin.WatchOS | xamarinwatchos was computed. |
-
.NETStandard 2.0
- No dependencies.
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Dreamine.MVVM.Attributes:
| Package | Downloads |
|---|---|
|
Dreamine.MVVM.Core
Core runtime package for Dreamine MVVM, including base ViewModel types, notification support, and foundational services. |
|
|
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.