Advertisement

Cascading values and parameter in .NET Blazor component (Part 4)

Cascading values and parameter in .NET Blazor component (Part 4) Cascading values and parameters in .NET Blazor

Cascading values and parameters solves the problem of transferring data from parent component to all the descendants. Cascading values and
parameters also provides an way for components to coordinate.

For example, theme information can be made to flow down the component hierarchy.A parent component can provide cascading value using the Cascading value component. The cascading Value component wraps a sub tree of the component hierarchy and supplies a single value to all components within that sub tree.

There is a Itab interface that Demotab implements

The index razor component uses the DemoTabSet component that has many child demo tab components


Child DemoTab component are not passed as parameter explicitly to the DemoTabset. Instead the child Tab components are part of the child content of the demotabset.
To render each demotab, the demotabset provides itself as cascading value that is picked up by the descendant child i.e, Demo Tab components.

The child tab components capture the hosting DemotabSet as a cascading parameter. And the child tabs gets added to the host and calculate to know the current active tab.

www.mobahi.com

Blazor,Blazor component inheritance,impliment interface,cascading,tab,cascading values,cascading parameters,

Post a Comment

0 Comments