@implements IDisposable;
@inject IEntityDialogService entityDialogService
@if (entity == null)
{
Entity is null
}
else
{
}
@code {
EntityModel entity = null;
private int refresh = 0;
protected override void OnInitialized()
{
entity = DATA.Get()[entityDialogService.GetEntityId()];
entityDialogService.Subscribe(OnUpdate);
}
public void Dispose() {
entityDialogService.Unsubscribe(OnUpdate);
}
void OnUpdate()
{
entity = DATA.Get()[entityDialogService.GetEntityId()];
refresh++;
Console.WriteLine("OnUpdate()");
StateHasChanged();
}
public void CloseDialog()
{
entityDialogService.CloseDialog();
}
}