@if (_isSelected) {

@Question

@BodySystem.ToDisplay() @if (IsSign) { Sign } @if (IsSymptom) { Symptom }
} else {

@Question

@BodySystem.ToDisplay() @if (IsSign) { Sign } @if (IsSymptom) { Symptom }
} @code { protected override void OnParametersSet() { base.OnParametersSet(); if (!Answer.IsNullOrEmpty()) { _isSelected = Answer == Question; } } [Parameter] public string Answer { get; set; } = string.Empty; [Parameter] public EventCallback AnswerChanged { get; set; } [Parameter] public string Question { get; set; } = string.Empty; [Parameter] public BodySystem BodySystem { get; set; } [Parameter] public bool IsSign { get; set; } [Parameter] public bool IsSymptom { get; set; } private bool _isSelected = false; private async Task SelectChanged() { _isSelected = !_isSelected; Answer = _isSelected ? Question : string.Empty; await AnswerChanged.InvokeAsync(Answer); } }