feat(Database) Adding entity dialog

This commit is contained in:
2022-04-01 17:35:10 -04:00
parent c4f1b86f27
commit a9d3920237
36 changed files with 429 additions and 150 deletions
+49
View File
@@ -0,0 +1,49 @@
using Model.Immortal.Entity;
namespace Services.Website;
public class EntityDialogService : IEntityDialogService
{
private string? entityId = null;
private event Action _onChange;
private void NotifyDataChanged() {
_onChange?.Invoke();
}
public void Subscribe(Action action) {
_onChange += action;
}
public void Unsubscribe(Action action) {
_onChange += action;
}
public void AddDialog(string id)
{
entityId = id;
NotifyDataChanged();
}
public void CloseDialog()
{
entityId = null;
NotifyDataChanged();
}
public bool HasDialog()
{
return entityId != null;
}
public string? GetEntityId()
{
return entityId;
}
}