using Hyperbar.Interop.Windows; using Hyperbar.UI.Windows; using Microsoft.Extensions.DependencyInjection; using Microsoft.UI.Xaml.Markup; namespace Hyperbar.Widget.Windows; public static class IServiceCollectionExtensions { public static IServiceCollection AddWidgetWindows(this IServiceCollection services) { // 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((Func>)(provider => new ProxyServiceCollection(services => { services.AddSingleton(provider.GetRequiredService>()); services.AddSingleton(provider.GetRequiredService()); services.AddTransient(); services.AddTransient(); services.AddScoped(); services.AddHandler(); services.AddHandler(); services.AddHandler(); services.AddTransient(); services.AddTransient(); services.AddTransient(); services.AddContentTemplate(); services.AddContentTemplate(); }))); return services; } }