// GET: AR
        public ActionResult Index()
        {
            var viewModel = new ARViewModel
            {
                Titulo  = "Prueba de ViewModel",
                Mensaje = "Creado mediante template"
            };

            return(View(viewModel));
        }
예제 #2
0
        /// <summary>
        /// Gets a reference to the ViewModel and the ArFragment
        /// </summary>
        /// <param name="e"></param>
        protected override void OnElementChanged(ElementChangedEventArgs <Xamarin.Forms.Page> e)
        {
            base.OnElementChanged(e);
            var activity = this.Context as Activity;

            this.viewModel = this.Element.BindingContext as ARViewModel;

            this.view = activity.LayoutInflater.Inflate(Resource.Layout.ARLayout, this, false);
            AddView(this.view);

            this.arFragment = activity.GetFragmentManager().FindFragmentById(Resource.Id.ar_fragment) as ArFragment;
            if (this.arFragment != null)
            {
                ModelRenderable.InvokeBuilder().SetSource(this.context, Resource.Raw.andy).Build(renderable =>
                {
                    andyRenderable = renderable;
                });
                arFragment.TapArPlane += OnTapArPlane;
            }
        }