feat: add overlay dialog sample.

This commit is contained in:
rabbitism
2024-01-22 18:32:24 +08:00
parent 5c62131a0a
commit f0ec32c870
10 changed files with 139 additions and 9 deletions

View File

@@ -47,7 +47,7 @@ public static class DialogBox
}
public static async Task<object?> ShowOverlayAsync<TView, TViewModel>(TViewModel vm, string hostId)
public static Task<TResult> ShowOverlayAsync<TView, TViewModel, TResult>(TViewModel vm, string hostId)
where TView : Control, new()
where TViewModel: new()
{
@@ -59,6 +59,6 @@ public static class DialogBox
t.DataContext = vm;
var host = OverlayDialogManager.GetOverlayDialogHost(hostId);
host?.AddDialog(t);
return null;
return t.ShowAsync<TResult>();
}
}