restructure project for part 2

This commit is contained in:
TheXamlGuy
2024-01-27 10:55:53 +00:00
parent a322893166
commit 48925b89ff
96 changed files with 383 additions and 351 deletions
@@ -0,0 +1,34 @@
using Hyperbar.Widget;
using Microsoft.Extensions.DependencyInjection;
namespace Hyperbar.Widget.Primary.Windows;
public class PrimaryWidget :
IWidget
{
public IWidgetBuilder Create() =>
WidgetBuilder<PrimaryWidgetConfiguration>.Configure(args =>
{
args.Name = "Primary commands";
args.Commands =
[
new KeyAcceleratorCommandConfiguration
{
Id = Guid.NewGuid(),
Order = 0,
Text = "Test",
Icon = "dd",
Key = 1
}
];
}).ConfigureServices(services =>
{
services.AddCache<(Guid ParentId, Guid Id), PrimaryCommandConfiguration>()
.AddCache<Guid, IWidgetComponentViewModel>()
.AddTransient<IProvider<PrimaryCommandConfiguration, IWidgetComponentViewModel?>, WidgetComponentProvider>()
.AddTransient<IFactory<PrimaryCommandConfiguration, IWidgetComponentViewModel?>, WidgetComponentFactory>()
.AddWidgetTemplate<PrimaryWidgetViewModel>()
.AddHandler<WidgetComponentViewModelEnumerator>()
.AddHandler<PrimaryWidgetConfigurationHandler>();
});
}