Quantcast
Channel: Active questions tagged blazor - Stack Overflow
Viewing all articles
Browse latest Browse all 4839

Blazor: How to Trigger EventCallback on Value Change

$
0
0

So I have an Textinput and I want to bind it to the parent. But I can not invoke the EventCallback from the setter as it is async.

My input is this,

<MudTextField @bind-Value="@(Code)"     Label="Hex"     Variant="Variant.Outlined" ></MudTextField>

And my property is this,

[Parameter]public string Code{    get => _Code;    set     {        _Code = value;       // Invoke the CodeChagned here so that the parent knows.    }}[Parameter]public EventCallback<string> CodeChanged { get; set; }

I need to update anoter filed in parent which is bind to the code property. But as I can not invoke this from setter and I do not have any button to have any clickable action to invoke. Then how can I do this?


Viewing all articles
Browse latest Browse all 4839

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>