CascadingValue<TValue> Class

Definition

A component that provides a cascading value to all descendant components.

C#
public class CascadingValue<TValue> : Microsoft.AspNetCore.Components.IComponent

Type Parameters

TValue
Inheritance
CascadingValue<TValue>
Implements

Constructors

Properties

ChildContent

The content to which the value should be provided.

IsFixed

If true, indicates that Value will not change. This is a performance optimization that allows the framework to skip setting up change notifications. Set this flag only if you will not change Value during the component's lifetime.

Name

Optionally gives a name to the provided value. Descendant components will be able to receive the value by specifying this name.

If no name is specified, then descendant components will receive the value based the type of value they are requesting.

Value

The value to be provided.

Methods

Attach(RenderHandle)

Attaches the component to a RenderHandle.

SetParametersAsync(ParameterView)

Sets parameters supplied by the component's parent in the render tree.

Applies to

Product Versions
ASP.NET Core 3.0, 3.1, 5.0, 6.0, 7.0, 8.0, 9.0