using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Autofac;
using Prism.Autofac;
using ComService;
using SimpleStm.Views;
using System.Windows;

namespace SimpleStm
{
    class Bootstrapper : AutofacBootstrapper
    {
        protected override DependencyObject CreateShell()
        {
            return Container.Resolve<MainWindow>();
        }

        protected override void InitializeShell()
        {
            Application.Current.MainWindow.Show();
        }

        protected override void ConfigureContainerBuilder(ContainerBuilder builder)
        {
            base.ConfigureContainerBuilder(builder);
            //builder.RegisterType<ComService.ComService>().As<IComService>().SingleInstance();
            builder.RegisterType<ComService.StmService>().SingleInstance();
            //builder.RegisterType<DummyPlcService>().As<IPlcService>().SingleInstance();
            builder.RegisterTypeForNavigation<MainPage>("MainPage");
            builder.RegisterTypeForNavigation<LeftMenu>("LeftMenu");
            builder.RegisterTypeForNavigation<StmStatusBar>("StmStatusBar");
            builder.RegisterTypeForNavigation<SettingsPage>("SettingsPage");
        }
    }
}
