@implements IDisposable; @inject IMyDialogService MyDialogService @code { protected override void OnInitialized() { base.OnInitialized(); MyDialogService.Subscribe(OnUpdate); } void IDisposable.Dispose() { MyDialogService.Unsubscribe(OnUpdate); } void OnUpdate() { StateHasChanged(); } }