Share via


CascadingValueServiceCollectionExtensions.AddCascadingValue Method

Definition

Overloads

AddCascadingValue<TValue>(IServiceCollection, Func<IServiceProvider,CascadingValueSource<TValue>>)

Adds a cascading value to the serviceCollection. This is equivalent to having a CascadingValue<TValue> at the root of the component hierarchy.

With this overload, you can supply a CascadingValueSource<TValue> which allows you to notify about updates to the value later, causing recipients to re-render. This overload should only be used if you plan to update the value dynamically.

AddCascadingValue<TValue>(IServiceCollection, Func<IServiceProvider,TValue>)

Adds a cascading value to the serviceCollection. This is equivalent to having a fixed CascadingValue<TValue> at the root of the component hierarchy.

AddCascadingValue<TValue>(IServiceCollection, String, Func<IServiceProvider,TValue>)

Adds a cascading value to the serviceCollection. This is equivalent to having a fixed CascadingValue<TValue> at the root of the component hierarchy.

AddCascadingValue<TValue>(IServiceCollection, Func<IServiceProvider,CascadingValueSource<TValue>>)

Source:
CascadingValueServiceCollectionExtensions.cs
Source:
CascadingValueServiceCollectionExtensions.cs

Adds a cascading value to the serviceCollection. This is equivalent to having a CascadingValue<TValue> at the root of the component hierarchy.

With this overload, you can supply a CascadingValueSource<TValue> which allows you to notify about updates to the value later, causing recipients to re-render. This overload should only be used if you plan to update the value dynamically.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddCascadingValue<TValue> (this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, Func<IServiceProvider,Microsoft.AspNetCore.Components.CascadingValueSource<TValue>> sourceFactory);
static member AddCascadingValue : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, Microsoft.AspNetCore.Components.CascadingValueSource<'Value>> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddCascadingValue(Of TValue) (serviceCollection As IServiceCollection, sourceFactory As Func(Of IServiceProvider, CascadingValueSource(Of TValue))) As IServiceCollection

Type Parameters

TValue

The value type.

Parameters

serviceCollection
IServiceCollection

The IServiceCollection.

sourceFactory
Func<IServiceProvider,CascadingValueSource<TValue>>

A callback that supplies a CascadingValueSource<TValue> within each service provider scope.

Returns

The IServiceCollection.

Applies to

AddCascadingValue<TValue>(IServiceCollection, Func<IServiceProvider,TValue>)

Source:
CascadingValueServiceCollectionExtensions.cs
Source:
CascadingValueServiceCollectionExtensions.cs

Adds a cascading value to the serviceCollection. This is equivalent to having a fixed CascadingValue<TValue> at the root of the component hierarchy.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddCascadingValue<TValue> (this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, Func<IServiceProvider,TValue> initialValueFactory);
static member AddCascadingValue : Microsoft.Extensions.DependencyInjection.IServiceCollection * Func<IServiceProvider, 'Value> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddCascadingValue(Of TValue) (serviceCollection As IServiceCollection, initialValueFactory As Func(Of IServiceProvider, TValue)) As IServiceCollection

Type Parameters

TValue

The value type.

Parameters

serviceCollection
IServiceCollection

The IServiceCollection.

initialValueFactory
Func<IServiceProvider,TValue>

A callback that supplies a fixed value within each service provider scope.

Returns

The IServiceCollection.

Applies to

AddCascadingValue<TValue>(IServiceCollection, String, Func<IServiceProvider,TValue>)

Source:
CascadingValueServiceCollectionExtensions.cs
Source:
CascadingValueServiceCollectionExtensions.cs

Adds a cascading value to the serviceCollection. This is equivalent to having a fixed CascadingValue<TValue> at the root of the component hierarchy.

public static Microsoft.Extensions.DependencyInjection.IServiceCollection AddCascadingValue<TValue> (this Microsoft.Extensions.DependencyInjection.IServiceCollection serviceCollection, string name, Func<IServiceProvider,TValue> initialValueFactory);
static member AddCascadingValue : Microsoft.Extensions.DependencyInjection.IServiceCollection * string * Func<IServiceProvider, 'Value> -> Microsoft.Extensions.DependencyInjection.IServiceCollection
<Extension()>
Public Function AddCascadingValue(Of TValue) (serviceCollection As IServiceCollection, name As String, initialValueFactory As Func(Of IServiceProvider, TValue)) As IServiceCollection

Type Parameters

TValue

The value type.

Parameters

serviceCollection
IServiceCollection

The IServiceCollection.

name
String

A name for the cascading value. If set, CascadingParameterAttribute can be configured to match based on this name.

initialValueFactory
Func<IServiceProvider,TValue>

A callback that supplies a fixed value within each service provider scope.

Returns

The IServiceCollection.

Applies to