feat: add prism extension.

This commit is contained in:
rabbitism
2024-02-03 23:01:29 +08:00
parent 0f97da7ce8
commit 6cf169e1d7
8 changed files with 121 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
using Avalonia.Controls;
using Prism.Ioc;
namespace Ursa.PrismExtension;
public static class UrsaDialogServiceExtension
{
internal const string UrsaDialogViewPrefix = "URSA_DIALOG_VIEW_";
public static void RegisterDialogService(this IContainerRegistry containerRegistry)
{
containerRegistry.RegisterSingleton<IUrsaDialogService, UrsaDialogService>();
containerRegistry.RegisterSingleton<IUrsaOverlayDialogService, UrsaOverlayDialogService>();
}
public static void RegisterUrsaDialogView<T>(this IContainerRegistry containerRegistry, string name) where T : Control
{
containerRegistry.Register<Control, T>(UrsaDialogViewPrefix+name);
}
}