I would like to retrieve the value of a RenderFragment for use in my code:
Parent Component
<SkillIndividual>
<Skill>Fireball</Skill>
<AttributeType>Fire</AttributeType>
</SkillIndividual>
Child Component (SkillIndividual.razor)
<span>@Skill</span> <span class="semi-transparent-text">(@AttributeType)</span>
@code {
[Parameter] public RenderFragment Skill { get; set; }
[Parameter] public RenderFragment AttributeType { get; set; }
private void CheckValue()
{
// Check the value of Skill (Fireball in this case)
}
}
I know I can create [Parameter] public string Skill {get;set;} but I feel like that would ruin the flow of my code. If I can take the value from RenderFragment that would make the code a lot cleaner.