Exemplo n.º 1
0
        public override void Initialize()
        {
            CreatableTypes()
            .Concat(extra.SelectMany(CreatableTypes))
            .EndingWith("Service")
            .AsInterfaces()
            .RegisterAsLazySingleton();

            Mvx.LazyConstructAndRegisterSingleton <IDalContainer, DalContainer>();
            Mvx.LazyConstructAndRegisterSingleton <IConfigReader, ConfigContainer>();
            Mvx.LazyConstructAndRegisterSingleton <IConfigContainer, ConfigContainer>();
            Mvx.LazyConstructAndRegisterSingleton <ILog, EmptyLogger>();
//            Mvx.LazyConstructAndRegisterSingleton<ISlackConnector, FakeSlack>();

            // ModelContext is injected on a IMiddleware and has a not-so-DI friendly constructor.
            Mvx.LazyConstructAndRegisterSingleton(() => Mvx.Resolve <IDalContainer>().Context);

            using (var ioc = new MvxSimpleIocImprovedCreator(CreatableTypes))
            {
                Compose <IMvxImprovedConfig,
                         IMvxImprovedLocatorConfig,
                         IMvxImprovedRegistry,
                         IMvxSimpleContainer>
                .NoobotCore(ioc.Registry);
            }

            RegisterCustomAppStart <MyNavigationAppStart>();
        }