@implements IDisposable;

@inject IGlossaryDialogService glossaryDialogService

@if (glossaryDialogService.HasDialog())
{
    <GlossaryDialogComponent></GlossaryDialogComponent>
}

@code {

    protected override void OnInitialized()
    {
        base.OnInitialized();
        glossaryDialogService.Subscribe(OnUpdate);
    }

    void IDisposable.Dispose()
    {
        glossaryDialogService.Unsubscribe(OnUpdate);
    }

    void OnUpdate()
    {
        StateHasChanged();
    }

}
