I need to create a Eventcallback for this following method
public async Task methodA(bool isLoading){ IsLoading = isLoading; this.StateHasChanged(); await Task.CompletedTask;}I've tried it using following
EventCallback callback=> EventCallback.Factory.Create(this, methodA);but I am getting a error called
can't convert method group to EventCallback
I need to create this event callback and pass it to the child components using cascading parameters as following
<CascadingValue Value=callback> @Body</CascadingValue> @code{ EventCallback callback=> EventCallback.Factory.Create(this, methodA); public async Task methodA(bool isLoading) { IsLoading = isLoading; this.StateHasChanged(); await Task.CompletedTask; } }so what is wrong with above code ??and how to create an eventcallback for above method?