One way binding component parameter to source #48656
Answered
by
david-acker
danielchalmers
asked this question in
Q&A
-
Is there an equivalent to WPF's |
Beta Was this translation helpful? Give feedback.
Answered by
david-acker
Jun 14, 2023
Replies: 1 comment
-
I'm not super familar with Blazor or WPF, so I'm not sure if this is 100% equivalent, but you could use an Example from the docs: Binding with component parameters [Parameter]
public int Year { get; set; }
[Parameter]
public EventCallback<int> YearChanged { get; set; }
private async Task UpdateYearFromChild()
{
await YearChanged.InvokeAsync(r.Next(1950, 2021));
} |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
javiercn
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm not super familar with Blazor or WPF, so I'm not sure if this is 100% equivalent, but you could use an
EventCallback
to notify the parent component when the component parameter is changed in the child.Example from the docs: Binding with component parameters