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
                    
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="Dreamine.MVVM.Attributes" Version="1.0.7" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Dreamine.MVVM.Attributes" Version="1.0.7" />
                    
Directory.Packages.props
<PackageReference Include="Dreamine.MVVM.Attributes" />
                    
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 Dreamine.MVVM.Attributes --version 1.0.7
                    
#r "nuget: Dreamine.MVVM.Attributes, 1.0.7"
                    
#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 Dreamine.MVVM.Attributes@1.0.7
                    
#: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=Dreamine.MVVM.Attributes&version=1.0.7
                    
Install as a Cake Addin
#tool nuget:?package=Dreamine.MVVM.Attributes&version=1.0.7
                    
Install as a Cake Tool

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.0 for 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.Readme or 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.* or Service.*
  • 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 path
  • BindTo: optional property that receives the return value
  • CommandName: 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.


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 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. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.
  • .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.

Version Downloads Last Updated
1.0.7 224 7/8/2026
1.0.6 275 4/29/2026
1.0.5 169 3/21/2026
1.0.4 154 2/20/2026
1.0.3 113 2/20/2026
1.0.2 404 5/26/2025
1.0.1 261 5/25/2025
1.0.0 274 5/25/2025