forked from amkovkov/GranuSightSoftware2
28 lines
985 B
C#
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>();
|
|
}
|