Продолжение рефакторинга (вынесение WPF в отдельный проект)

This commit is contained in:
2025-10-02 17:25:48 +04:00
parent 2fa94851cb
commit f5b311e025
161 changed files with 899 additions and 559 deletions
+30
View File
@@ -0,0 +1,30 @@
using Microsoft.Extensions.DependencyInjection;
using Pf2e.Scrapper.WPF.EntityViewer.Stores;
using Pf2e.Scrapper.WPF.EntityViewer.ViewModel;
namespace Pf2e.WPF;
/// <summary>
/// Расширение для IServiceCollection, позволяющее регистрировать сервисы WPF.
/// </summary>
public static class WpfServiceProviderExtension
{
/// <summary>
/// Регистрация сервисов WPF в IServiceCollection.
/// </summary>
/// <param name="collection">Коллекция сервисов.</param>
/// <returns>Коллекция сервисов (<paramref name="collection"/> для Fluent API).</returns>
public static IServiceCollection RegisterWpfServices(this IServiceCollection collection)
{
return collection
// ViewModels
.AddTransient<EntityFormViewModel>()
.AddTransient<EntityListViewModel>()
.AddTransient<ViewViewModel>()
// Stores
.AddSingleton<SelectedEntityTypeStore>()
.AddSingleton<SelectedEntityStore>()
//
;
}
}