Код: Выделить всё
public async Task methodA(bool isLoading)
{
IsLoading = isLoading;
this.StateHasChanged();
await Task.CompletedTask;
}
< /code>
Я попробовал это с помощью следующего: < /p>
EventCallback callback=> EventCallback.Factory.Create(this, methodA);
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
Код: Выделить всё
@Body
@code {
EventCallback callback => EventCallback.Factory.Create(this, methodA);
public async Task methodA(bool isLoading)
{
IsLoading = isLoading;
this.StateHasChanged();
await Task.CompletedTask;
}
}
< /code>
Так что не так с вышеуказанным кодом ?? и как создать EventCallback Подробнее здесь: https://stackoverflow.com/questions/727 ... -in-blazor
Мобильная версия