42 lines
1.0 KiB
C#
42 lines
1.0 KiB
C#
using System.Windows;
|
|
|
|
using CamBooth.App.Core.AppSettings;
|
|
using CamBooth.App.Core.Logging;
|
|
using CamBooth.App.Features.Camera;
|
|
using CamBooth.App.Features.PictureGallery;
|
|
|
|
using Microsoft.Extensions.DependencyInjection;
|
|
|
|
namespace CamBooth.App;
|
|
|
|
/// <summary>
|
|
/// Interaction logic for App.xaml
|
|
/// </summary>
|
|
public partial class App : Application
|
|
{
|
|
private IServiceProvider _serviceProvider;
|
|
|
|
protected override void OnStartup(StartupEventArgs e)
|
|
{
|
|
base.OnStartup(e);
|
|
|
|
var services = new ServiceCollection();
|
|
ConfigureServices(services);
|
|
|
|
_serviceProvider = services.BuildServiceProvider();
|
|
|
|
var mainWindow = _serviceProvider.GetRequiredService<MainWindow>();
|
|
mainWindow.Show();
|
|
}
|
|
|
|
|
|
private void ConfigureServices(IServiceCollection services)
|
|
{
|
|
// Register your services and view models here
|
|
services.AddTransient<MainWindow>();
|
|
services.AddSingleton<Logger>();
|
|
services.AddSingleton<AppSettingsService>();
|
|
services.AddSingleton<PictureGalleryService>();
|
|
services.AddSingleton<CameraService>();
|
|
}
|
|
} |