Example #1
0
        public TResult Build <TBuildable, TResult>(IMvxAutoView view, KeyedDescription description)
        {
            var bindingViewController = view as IMvxTouchView;

            if (bindingViewController == null)
            {
                throw new MvxException(
                          "View passed to MvxTouchUserInterfaceFactory must be an IMvxBindingViewController - type {0}",
                          view.GetType().Name);
            }

            var registry = Mvx.Resolve <IBuilderRegistry>();
            var builder  = new MvxTouchUserInterfaceBuilder(bindingViewController, view.ViewModel, registry);
            var root     = (TResult)builder.Build(typeof(TBuildable), description);

            return(root);
        }
        public TResult Build <TBuildable, TResult>(IMvxAutoView view, KeyedDescription description)
        {
            var bindingActivity = view as IMvxBindingContextOwner;

            if (bindingActivity == null)
            {
                throw new MvxException(
                          "Activity passed to MvxAndroidUserInterfaceFactory must be an IMvxAndroidBindingContext - type {0}",
                          view.GetType().Name);
            }

            var registry = Mvx.Resolve <IBuilderRegistry>();
            var builder  = new MvxAndroidUserInterfaceBuilder((IMvxAndroidBindingContext)bindingActivity.BindingContext,
                                                              view.ViewModel, registry);
            var root = (TResult)builder.Build(typeof(TBuildable), description);

            return(root);
        }