@implements IDisposable; @inject IMyDialogService MyDialogService @inject IJSRuntime JsRuntime @inject NavigationManager NavigationManager @if (MyDialogService.IsVisible) {
@MyDialogService.GetDialogContents().Title
@MyDialogService.GetDialogContents().Message
Cancel @MyDialogService.GetDialogContents().ConfirmButtonLabel
} @code { protected override void OnInitialized() { base.OnInitialized(); MyDialogService.Subscribe(StateHasChanged); } void IDisposable.Dispose() { MyDialogService.Unsubscribe(StateHasChanged); } public void CloseDialog() { MyDialogService.Hide(); } }