CascadingParameter Events

ANB 181 Reputation points
2022-07-14T15:28:57.123+00:00

I have a textbox on my parent component and its value is sent to the child component through <CascadingValue>.
And using [CascadingParameter] on my child, I am able to receive the right value without problems.

However, every time this textbox value is changed on the parent component, I need to execute a method on the child component using this value received.
Is there any events for CascadingParameter ? Or how can I know when the CascadingParameter was changed ?

Thx

Developer technologies .NET Blazor
{count} votes

1 answer

Sort by: Most helpful
  1. Michael Washington 921 Reputation points MVP
    2022-07-15T14:08:10.84+00:00

    If after the CascadingParameter is changed, you call:
    StateHasChanged();
    That should update the children.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.