using Hyperbar.Interop.Windows; using Hyperbar.UI.Windows; using Microsoft.Extensions.DependencyInjection; using Microsoft.UI.Xaml.Markup; using System.Collections.Generic; namespace Hyperbar.Widget.Windows; public static class IServiceCollectionExtensions { public static IServiceCollection AddWidgetWindows(this IServiceCollection services) { services.AddContentTemplate(); // We need to feed information to the Widgets about our Windows host, // so the Windows host can make discussions how to display and interact with the widgets. services.AddTransient>(provider => new ProxyServiceCollection(services => { services.AddSingleton(provider.GetRequiredService>()); services.AddSingleton(provider.GetRequiredService()); services.AddTransient(); services.AddScoped(); services.AddHandler(); services.AddHandler(); services.AddHandler(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddContentTemplate(); services.AddContentTemplate(); })); return services; } }