Added json configuration

This commit is contained in:
TheXamlGuy
2024-01-05 17:34:09 +00:00
parent d94add17f9
commit e180c966ff
33 changed files with 527 additions and 40 deletions
@@ -1,26 +0,0 @@
using Microsoft.Extensions.DependencyInjection;
using Microsoft.Extensions.Hosting;
namespace Hyperbar.Desktop
{
public static class IServiceCollectionExtensions
{
public static IServiceCollection AddSomething<TCommandBuilder>(this IServiceCollection services)
where TCommandBuilder :
ICommandBuilder, new()
{
TCommandBuilder builder = new();
IHost? host = new HostBuilder()
.ConfigureServices(services =>
{
services.AddTransient<ITemplateFactory, TemplateFactory>();
services.AddTransient<ITemplateGeneratorFactory, TemplateGeneratorFactory>();
builder.Create(services);
}).Build();
services.AddTransient<ICommandContext>(provider => new CommandContext(host.Services));
return services;
}
}
}
@@ -1,4 +1,5 @@
using Microsoft.Extensions.DependencyInjection;
using Hyperbar.Templates;
using Microsoft.Extensions.DependencyInjection;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
using System;
@@ -1,4 +1,5 @@
using Microsoft.UI.Xaml;
using Hyperbar.Templates;
using Microsoft.UI.Xaml;
using Microsoft.UI.Xaml.Controls;
namespace Hyperbar.Desktop;