예제 #1
0
파일: Setup.cs 프로젝트: slodge/CrossLight
        public void EnsureInitialized(Context applicationContext)
        {
            if (MvxSimpleIoCContainer.Instance != null)
                return;

            var ioc = MvxSimpleIoCContainer.Initialise();

            ioc.RegisterSingleton<IMvxTrace>(new MvxDebugOnlyTrace());
            ioc.RegisterSingleton<IMvxPluginManager>(new MvxFileBasedPluginManager("Droid"));

            ioc.RegisterSingleton<IMvxAndroidGlobals>(new AndroidGlobals(applicationContext));

            var topActivity = new AndroidTopActivity();
            ioc.RegisterSingleton<ITopActivity>(topActivity);
            ioc.RegisterSingleton<IMvxAndroidCurrentTopActivity>(topActivity);
            ioc.RegisterSingleton<IMvxMainThreadDispatcherProvider>(topActivity);

            var builder = new MvxDroidBindingBuilder(ignored => { }, ignored => { }, ignored => { });
            builder.DoRegistration();
        }
예제 #2
0
        public void EnsureInitialized(Context applicationContext)
        {
            if (MvxSimpleIoCContainer.Instance != null)
            {
                return;
            }

            var ioc = MvxSimpleIoCContainer.Initialise();

            ioc.RegisterSingleton <IMvxTrace>(new MvxDebugOnlyTrace());
            ioc.RegisterSingleton <IMvxPluginManager>(new MvxFilePluginManager(".Droid", ".dll"));

            ioc.RegisterSingleton <IMvxAndroidGlobals>(new AndroidGlobals(applicationContext));

            var topActivity = new AndroidTopActivity();

            ioc.RegisterSingleton <ITopActivity>(topActivity);
            ioc.RegisterSingleton <IMvxAndroidCurrentTopActivity>(topActivity);
            ioc.RegisterSingleton <IMvxMainThreadDispatcher>(topActivity);

            var builder = new MvxAndroidBindingBuilder(ignored => { }, ignored => { }, ignored => { });

            builder.DoRegistration();
        }