CascadingValueServiceCollectionExtensions.AddCascadingValue Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
AddCascadingValue<TValue>(IServiceCollection, Func<IServiceProvider,CascadingValueSource<TValue>>) |
Adds a cascading value to the 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 |
AddCascadingValue<TValue>(IServiceCollection, String, Func<IServiceProvider,TValue>) |
Adds a cascading value to the |
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.
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>)
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>)
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.