Files
GSS2Rework/GSS2/DependencyInjectionHelper.cs
T
2026-04-13 09:29:03 +03:00

28 lines
985 B
C#

using Microsoft.Extensions.DependencyInjection;
using GSS2.UI.Core.ViewModels;
using GSS2.UI.Core.Services;
using GSS2.Views;
using GSS2.ViewModels;
using Microsoft.Extensions.Logging;
namespace GSS2;
public static class DependencyInjectionHelper
{
public static IServiceCollection AddViewsAndModels(this IServiceCollection services) =>
services
.AddSingleton<DependencyInjectionViewLocator>((services) =>
new DependencyInjectionViewLocator(
services.GetRequiredService<ILogger<DependencyInjectionViewLocator>>(),
services
)
)
.AddSingleton<NavigationService>((_) => new NavigationService(Application.Current?.ApplicationLifetime))
.AddSingleton<MainWindowViewModel>()
.AddSingleton<MainView>()
.AddSingleton<MainViewModel>()
.AddSingleton<AmineContentView>()
.AddSingleton<AmineContentViewModel>();
}