Exemplo n.º 1
0
        protected virtual void InitializeViewLookup()
        {
            var viewAssemblies      = GetViewAssemblies();
            var builder             = new MvxViewModelViewLookupBuilder();
            var viewModelViewLookup = builder.Build(viewAssemblies);

            if (viewModelViewLookup == null)
            {
                return;
            }

            var container = Mvx.Resolve <IMvxViewsContainer>();

            container.AddAll(viewModelViewLookup);
        }
Exemplo n.º 2
0
        public void IncludeMvvmcross64()
        {
            _ = new MvxSettings();
            _ = new MvxStringToTypeParser(); //??
            //_ = new MvxPluginManager(null); //should not be required
            _ = new MvxViewModelLoader(null);
            _ = new MvxNavigationService(null, null);
            _ = new MvxViewModelByNameLookup();

            _ = new MvxViewModelViewTypeFinder(null, null);
            _ = new MvxViewModelViewLookupBuilder();
            _ = new MvxCommandCollectionBuilder();
            _ = new MvxStringDictionaryNavigationSerializer();
            _ = new MvxChildViewModelCache();
            _ = new MvxWeakCommandHelper();
        }
        public void Test_Builder()
        {
            ClearAll();

            var assembly            = this.GetType().Assembly;
            var viewModelNameLookup = new MvxViewModelByNameLookup(new[] { assembly });
            var finder = new MvxViewModelViewTypeFinder(viewModelNameLookup);

            Ioc.RegisterSingleton <IMvxViewModelTypeFinder>(finder);

            var builder = new MvxViewModelViewLookupBuilder();
            var result  = builder.Build(new[] { assembly });

            Assert.AreEqual(3, result.Count);
            Assert.AreEqual(typeof(Test1View), result[typeof(Test1ViewModel)]);
            Assert.AreEqual(typeof(NotTest2View), result[typeof(Test2ViewModel)]);
            Assert.AreEqual(typeof(NotTest3View), result[typeof(Test3ViewModel)]);
        }
        public void Test_Builder()
        {
            ClearAll();

            var assembly            = this.GetType().Assembly;
            var viewModelNameLookup = new MvxViewModelByNameLookup();

            viewModelNameLookup.AddAll(assembly);
            var nameMapping = new MvxPostfixAwareViewToViewModelNameMapping("View", "Oddness");
            var finder      = new MvxViewModelViewTypeFinder(viewModelNameLookup, nameMapping);

            Ioc.RegisterSingleton <IMvxViewModelTypeFinder>(finder);

            var builder = new MvxViewModelViewLookupBuilder();
            var result  = builder.Build(new[] { assembly });

            Assert.AreEqual(4, result.Count);
            Assert.AreEqual(typeof(Test1View), result[typeof(Test1ViewModel)]);
            Assert.AreEqual(typeof(NotTest2View), result[typeof(Test2ViewModel)]);
            Assert.AreEqual(typeof(NotTest3View), result[typeof(Test3ViewModel)]);
            Assert.AreEqual(typeof(OddNameOddness), result[typeof(OddNameViewModel)]);
        }
Exemplo n.º 5
0
 public void Include(MvxViewModelViewLookupBuilder builder)
 {
     _ = new MvxViewModelViewLookupBuilder();
 }