feat: implement closing related features.

This commit is contained in:
rabbitism
2024-01-22 17:27:11 +08:00
parent 9cff01c032
commit 5c62131a0a
6 changed files with 70 additions and 20 deletions

View File

@@ -84,6 +84,17 @@ public class OverlayDialogHost: Canvas
public void AddDialog(DialogControl control)
{
this.Children.Add(control);
control.OnClose += OnDialogClose;
}
private void OnDialogClose(object sender, object? e)
{
if (sender is DialogControl control)
{
this.Children.Remove(control);
control.OnClose -= OnDialogClose;
}
}
public void AddModalDialog(DialogControl control)