@inject IJSRuntime JS @inject State State @if (Editable) { } @if(statuses != null) foreach(Status status in statuses) { } @code { [Parameter] public Func?>> StatusFunc { get; set; } [Parameter] public bool Editable { get; set; } = false; public EditStatusDialog? Dialog { get; set; } private List? statuses; protected override async Task OnInitializedAsync() { await base.OnInitializedAsync(); if (statuses == null || statuses.Count == 0) statuses = await StatusFunc(); await InvokeAsync(StateHasChanged); await JS.InvokeVoidAsync("removeElementById", "statusLoading"); } }