Add project files.

This commit is contained in:
2025-07-06 17:36:00 +02:00
parent 57be803688
commit 9e7a75b8c3
17 changed files with 426 additions and 0 deletions

View File

@ -0,0 +1,15 @@
using Microsoft.Extensions.DependencyInjection;
using System;
namespace WinGreedWPF.StartupHelpers;
public static class ServiceExtensions
{
public static void AddFormFactory<TForm>(this IServiceCollection services)
where TForm : class
{
services.AddTransient<TForm>();
services.AddSingleton<Func<TForm>>(x => () => x.GetService<TForm>()!);
services.AddSingleton<IAbstractFactory<TForm>, AbstractFactory<TForm>>();
}
}