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