using Unity;
using Valg.Eva.Skanning.Scan.Presentation.RegisterBarcode.Barcode;
using Valg.EVA.Skanning.ContainerExtensions;
using Valg.EVA.Skanning.Sample.Startup.Ballot;
using Valg.EVA.Skanning.Sample.Startup.Box;
using Valg.EVA.Skanning.Verify.Startup.BoxIsLocked;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.ReadModel;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.VerifiableViewModelsCollection;
using Valg.EVA.Skanning.Verify.Startup.VerifyBallotPaper.WriteModel;
using NavigateBallotsViewModel = Valg.EVA.Skanning.Sample.Startup.Box.NavigateBallotsViewModel;

namespace Valg.EVA.Skanning.Sample.Startup
{
    public class UnityInstaller : IUnityInstaller
    {
        [System.Diagnostics.CodeAnalysis.SuppressMessage("Microsoft.Reliability", "CA2000:Dispose objects before losing scope")]
        public void Install(IUnityContainer unityContainer)
        {
            unityContainer.RegisterType<IMainWindowInitializer, MainWindowInitializer>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IMainWindowViewModel, MainWindowViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IMainWindow, Valg.EVA.Skanning.Sample.Startup.MainWindow>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<NavigateBallotsViewModel, NavigateBallotsViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<BallotControlViewModel, BallotControlViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<BallotControl, Valg.EVA.Skanning.Sample.Startup.Ballot.BallotControl>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<BoxControlViewModel, BoxControlViewModel>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<BoxControl, Valg.EVA.Skanning.Sample.Startup.Box.BoxControl>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
            unityContainer.RegisterType<IBarcodeValidator, BarcodeValidator>(ContainerLifetimes.CreateContainerControlledLifetimeManager());
        }
    }
}

