feat: setup demo.
This commit is contained in:
23
src/Ursa/Controls/Dialog/OverlayDialogManager.cs
Normal file
23
src/Ursa/Controls/Dialog/OverlayDialogManager.cs
Normal file
@@ -0,0 +1,23 @@
|
||||
using System.Collections.Concurrent;
|
||||
|
||||
namespace Ursa.Controls;
|
||||
|
||||
internal static class OverlayDialogManager
|
||||
{
|
||||
private static ConcurrentDictionary<string, OverlayDialogHost> _hosts = new();
|
||||
|
||||
public static void RegisterOverlayDialogHost(OverlayDialogHost host, string id)
|
||||
{
|
||||
_hosts.TryAdd(id, host);
|
||||
}
|
||||
|
||||
public static void UnregisterOverlayDialogHost(string id)
|
||||
{
|
||||
_hosts.TryRemove(id, out _);
|
||||
}
|
||||
|
||||
public static OverlayDialogHost? GetOverlayDialogHost(string id)
|
||||
{
|
||||
return _hosts.TryGetValue(id, out var host) ? host : null;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user