Ryme
✅ Two-way binding class object Blazor Server
If I were to change the type to a
string
or an int
, then the parent component would update automatically through the two-way binding without needing to call StateHasChanged()
and thus avoiding running component/page initializers again.
Is this behavior based on the reference or pointer being updated?
As you pointed out, the example isn't very useful other than for me to try and understand how this works behind the hood.
I also tried @bind-Value:event="@(() => Console.WriteLine("Value was updated"))"
but this doesn't trigger either which makes me think I don't understand the inner works of it.
If you have any insight on how this works and what is "best-practice", I'm glad to hear!
Thanks8 replies