allow new items to be added to sub menus at runtime, from a config file

This commit is contained in:
TheXamlGuy
2024-01-18 22:28:53 +00:00
parent 78cedcdeb8
commit 2fed876182
8 changed files with 110 additions and 47 deletions
@@ -8,7 +8,9 @@ public class PrimaryWidgetProvider :
{
public void Create(HostBuilderContext comtext, IServiceCollection services) =>
services.AddConfiguration<PrimaryWidgetConfiguration>()
.AddCache<(Guid ParentId, Guid Id), PrimaryCommandConfiguration>()
.AddCache<Guid, IWidgetComponentViewModel>()
.AddTransient<IProvider<PrimaryCommandConfiguration, IWidgetComponentViewModel?>, WidgetComponentViewModelProvider>()
.AddTransient<IFactory<PrimaryCommandConfiguration, IWidgetComponentViewModel?>, WidgetComponentViewModelFactory>()
.AddTransient<IViewModelEnumerator<IWidgetComponentViewModel>, WidgetComponentViewModelEnumerator>()
.AddWidgetTemplate<PrimaryWidgetViewModel>()