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 : AttributeInheritance
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
Lifetime
Gets or sets the lifetime of the ViewModel in the dependency injection container. The default is Transient.
public ServiceLifetime Lifetime { get; set; }