Blazor one-way binding from child to parent component

330 Views Asked by At

I would like to ask whether it is possible to implement one-way binding from child to parent component. Meaning that when I change property in child component it also changes in parent component but when I change property in parent component it doesn't change in child component.

In ParentComponent.razor I want to have:

    <ChildComponent @bind-one-way-Token="Token">

I know that in Blazor I can implement Two-Way binding via implementation of Property + PropertyChanged event. But two way binding is not suitable for my use case. I know I can pass value from child component to parent component via EventCallback / StateContainer, but these are not as elegant as binding.

0

There are 0 best solutions below