feat: setup demo.

This commit is contained in:
rabbitism
2024-01-20 22:46:23 +08:00
parent 0e91c844a7
commit 497a8c2d02
10 changed files with 143 additions and 4 deletions

View File

@@ -1,4 +1,7 @@
using Avalonia;
using Avalonia.Controls;
using Avalonia.Controls.Shapes;
using Avalonia.Media;
namespace Ursa.Controls;
@@ -15,6 +18,20 @@ public static class DialogBox
{
TView t = new TView();
t.DataContext = vm;
return;
}
public static async Task<object?> ShowOverlayAsync<TView, TViewModel>(TViewModel vm, string hostId)
where TView : Control, new()
where TViewModel: new()
{
var t = new Border()
{
Width = 100, Height = 100, Background = Brushes.Aqua, BorderBrush = Brushes.Yellow,
BorderThickness = new Thickness(1)
};
t.DataContext = vm;
var host = OverlayDialogManager.GetOverlayDialogHost(hostId);
host?.Children.Add(t);
return null;
}
}