Esempio n. 1
0
        protected App()
        {
            var locator = new FuncServiceLocator();

            RxApp.ConfigureServiceLocator(
                (t, s) => locator.GetAllServices(t, s).FirstOrDefault(),
                (t, s) => locator.GetAllServices(t, s).ToArray(),
                (c, t, s) => locator.Register(() => Activator.CreateInstance(c), t, s));

            locator.Register(() => typeof(MainView), typeof(IViewFor <MainViewModel>));
            locator.Register(() => typeof(SecondaryView), typeof(IViewFor <SecondaryViewModel>));

            RxApp.Register(typeof(AppBootstrapper), typeof(IApplicationRootState));

            Locator = locator;
        }
Esempio n. 2
0
        protected App()
        {
            var locator = new FuncServiceLocator();

            RxApp.ConfigureServiceLocator(
                (t,s) => locator.GetAllServices(t,s).FirstOrDefault(),
                (t,s) => locator.GetAllServices(t,s).ToArray(),
                (c,t,s) => locator.Register(() => Activator.CreateInstance(c), t, s));

            locator.Register(() => typeof(MainView), typeof(IViewFor<MainViewModel>));
            locator.Register(() => typeof(SecondaryView), typeof(IViewFor<SecondaryViewModel>));

            RxApp.Register(typeof(AppBootstrapper), typeof(IApplicationRootState));

            Locator = locator;
        }