more refoctoring work

This commit is contained in:
TheXamlGuy
2024-01-20 21:58:57 +00:00
parent 3a268db79d
commit 45070dc560
42 changed files with 477 additions and 361 deletions
+24
View File
@@ -0,0 +1,24 @@
using Microsoft.Extensions.DependencyInjection;
namespace Hyperbar.Windows.Primary;
public class PrimaryWidget :
IWidget
{
public IWidgetBuilder Create() =>
WidgetBuilder.Configure<PrimaryWidgetConfiguration>(args =>
{
args.Id = Guid.Parse("cfdfe07c-d9d6-4174-ae41-988ca24d2e10");
args.Name = "Primary commands";
}).ConfigureServices(args =>
{
args.AddCache<(Guid ParentId, Guid Id), PrimaryCommandConfiguration>()
.AddCache<Guid, IWidgetComponentViewModel>()
.AddTransient<IProvider<PrimaryCommandConfiguration, IWidgetComponentViewModel?>, WidgetComponentProvider>()
.AddTransient<IFactory<PrimaryCommandConfiguration, IWidgetComponentViewModel?>, WidgetComponentFactory>()
.AddTransient<IEnumerator<IWidgetComponentViewModel>, WidgetComponentEnumerator>()
.AddWidgetTemplate<PrimaryWidgetViewModel>()
.AddHandler<PrimaryWidgetConfigurationHandler>();
});
}