Table of Contents

Class ViewModelDefinitionAttribute

Namespace
Blazing.Mvvm.ComponentModel
Assembly
Blazing.Mvvm.Base.dll

Specifies metadata for a ViewModel to control its registration in the dependency injection container. Supports configuration of service lifetime and optional keyed registration.

[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public class ViewModelDefinitionAttribute : Attribute

Inheritance

Derived

Inherited Members

Properties

Key

Gets or sets the key for the ViewModel. When set, the ViewModel is registered as a keyed service.

public object? Key { get; set; }

Property Value

object?

Lifetime

Gets or sets the lifetime of the ViewModel in the dependency injection container. The default is Transient.

public ServiceLifetime Lifetime { get; set; }

Property Value

ServiceLifetime