@implements IDisposable; @inject IEntityDialogService entityDialogService
@if (entity == null) {
Entity is null
} else {
@if (entityDialogService.HasHistory()) { }
@entity.Info().Name
}
@code { EntityModel entity = default!; private int refresh = 0; protected override void OnInitialized() { entity = DATA.Get()[entityDialogService.GetEntityId() ?? string.Empty]; entityDialogService.Subscribe(OnUpdate); } void IDisposable.Dispose() { entityDialogService.Unsubscribe(OnUpdate); } void OnUpdate() { entity = DATA.Get()[entityDialogService.GetEntityId()]; refresh++; StateHasChanged(); } public void CloseDialog() { entityDialogService.CloseDialog(); } }