Refresh a component visibility

This is a common Blazor issue - it doesn't flush UI updates immediately after calling StateHasChanged - it buffers them instead. As a result the UI will update after your entire method finishes. Users have had success by adding await Task.Delay(1); or await Task.Yield() before the long running operation: TIP: Display IsBusy on long server method

Also you can check our forum FAQ for tips how to format your code.