@implements IDisposable; @inject IGlossaryDialogService glossaryDialogService @if (glossaryDialogService.HasDialog()) { } @code { protected override void OnInitialized() { base.OnInitialized(); glossaryDialogService.Subscribe(OnUpdate); } void IDisposable.Dispose() { glossaryDialogService.Unsubscribe(OnUpdate); } void OnUpdate() { InvokeAsync(StateHasChanged); } }