Given a child and a parent component I am trying to execute a method within the child
when a parameter
has changed (from the parent).
Parent
<Child value=@IsChanged></Child>
<button onclick="Update"></button>
@functions(){
public bool IsChanged{get;set;}
public void Update()
{
this.IsChanged!=this.IsChanged;
}
Child
@(value?"True":"False")
@functions()
{
[Parameter]
protected bool value {get;set;}
public void SideEffect()
{
Console.WriteLine("has changed"); //i want this method executed when value changes from parent
}
As you can see i need to execute the method inside the Child
onchange of the parameter.The parameter is changed in the parent.
P.S
I have looked on the onchange
eventhandler but i need to execute on a [Parameter]
.