Class ViewModelKeyAttribute
- Namespace
- Blazing.Mvvm.Components
- Assembly
- Blazing.Mvvm.dll
Specifies a key for a ViewModel on a View component, enabling keyed navigation and route mapping in Blazor MVVM applications.
This attribute should only be used on View components.
[AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]
public sealed class ViewModelKeyAttribute : AttributeInheritance
Inherited Members
Constructors
ViewModelKeyAttribute(object)
Initializes a new instance of the ViewModelKeyAttribute class with the specified key.
public ViewModelKeyAttribute(object key)Parameters
keyobject-
The key to associate with the
ViewModelfor navigation and route mapping.
Exceptions
- ArgumentNullException
-
Thrown when the
keyis null.
Properties
Key
Gets the key associated with the ViewModel for keyed navigation.
public object Key { get; }