Feature Request - Reusable razor component without polymorphism #24352
Labels
area-blazor
Includes: Blazor, Razor Components
Needs: Author Feedback
The author of this issue needs to respond in order for us to continue investigating this issue.
What problem are you trying to solve?
Here is a simplified version of what I am trying to solve.
I am working on a razor component that uses a
<select>
to choose the value of a property on a tracked entity.I have a base
Dropdown
class and multiple classes that derive from it, e.g.Color
, which is a property on the tracked entity.To make the razor component generic enough, I pass in a
List<Dropdown>
created from aList<Color>
.After the
<select>
is changed, I want to assign the new choice to theColor
on the tracked entity.There is no way I can find to set the
Color
property directly - razor component doesn't know it's aColor
and no way to create aColor
object using its type and the values from theList<Dropdown>
corresponding to<select>
value.Without polymorphism support, is there a way it can be accomplished, or is it a current limitation?
Describe the solution you'd like
This is an idea:
The text was updated successfully, but these errors were encountered: