

<MudTextField T="string" 
              ValueChanged="async answer => { Answer = answer; await AnswerChanged.InvokeAsync(Answer); }"
              Label="@Question" 
              Value="@Answer" 
              Variant="Variant.Outlined" />

@code {

    public override async Task SetParametersAsync(ParameterView parameters)
    {
        
        await base.SetParametersAsync(parameters);
        if (!OldAnswer.IsNullOrEmpty())
        {
            if(Answer==OldAnswer)
                return;
            Answer = OldAnswer;
            await AnswerChanged.InvokeAsync();
        }
    }

    [Parameter]
    public string OldAnswer { get; set; } = string.Empty;

    [Parameter]
    public string Answer { get; set; } = string.Empty;

    [Parameter]
    public EventCallback<string> AnswerChanged { get; set; }

    [Parameter]
    public string Question { get; set; } = string.Empty;

}
