-
Notifications
You must be signed in to change notification settings - Fork 10.5k
Closed
Labels
Components Big RockThis issue tracks a big effort which can span multiple issuesThis issue tracks a big effort which can span multiple issuesNeeds: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentscomponent ecosystemIndicates an issue which also has impact on 3rd party component ecosystemIndicates an issue which also has impact on 3rd party component ecosystemenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing oneseverity-blockingThis label is used by an internal toolThis label is used by an internal tool
Description
Is your feature request related to a problem? Please describe.
If you have a templated component, that's Generic and uses @typeparam, if you want to add other child components, you also have to specify the type when you declare them. For instance in a Grid:
<Grid Data=List<Item>>
<Columns>
<Column TItem=Item>
<Template />
</Column>
</Columns>
</Grid>
In this setup, in order to have a strongly typed context passed to the Column templates, you have to specify explicitly TItem to each Column and cannot be inferred by the List.
Describe the solution you'd like
With the current setup we can pass simple parameters down to child components with:
<CascadingValue Value=this>
@Columns
</CascadingValue>
I would like to have the ability to aslo pass down @typeparam values. Perhaps something like:
<CascadingType Value=TItem>
@Columns
</CascadingType>
And if the child component declares it's own TItem, it will override the Cascading value.
EdCharbeneau, mwinkler, hadjieva, jivanova, kswoll and 29 moreSommerEngineering
Metadata
Metadata
Assignees
Labels
Components Big RockThis issue tracks a big effort which can span multiple issuesThis issue tracks a big effort which can span multiple issuesNeeds: DesignThis issue requires design work before implementating.This issue requires design work before implementating.affected-fewThis issue impacts only small number of customersThis issue impacts only small number of customersarea-blazorIncludes: Blazor, Razor ComponentsIncludes: Blazor, Razor Componentscomponent ecosystemIndicates an issue which also has impact on 3rd party component ecosystemIndicates an issue which also has impact on 3rd party component ecosystemenhancementThis issue represents an ask for new feature or an enhancement to an existing oneThis issue represents an ask for new feature or an enhancement to an existing oneseverity-blockingThis label is used by an internal toolThis label is used by an internal tool