Exemple #1
0
        public override void SetVirtualView(IView view)
        {
            if (VisualElementRenderer == null && Context != null)
            {
                var renderer = Internals.Registrar.Registered.GetHandlerForObject <IVisualElementRenderer>(view, Context)
                               ?? new Platform.Android.AppCompat.Platform.DefaultRenderer(Context);

                SetupRenderer(renderer);
            }

            if (VisualElementRenderer.Element != view)
            {
                VisualElementRenderer.SetElement((VisualElement)view);
            }
            else
            {
                base.SetVirtualView(view);
            }
        }
Exemple #2
0
        public override void SetVirtualView(IView view)
        {
            if (VisualElementRenderer == null)
            {
                var renderer = Internals.Registrar.Registered.GetHandlerForObject <IVisualElementRenderer>(view)
                               ?? new Xamarin.Forms.Platform.iOS.Platform.DefaultRenderer();

                SetupRenderer(renderer);
            }

            if (VisualElementRenderer.Element != view)
            {
                VisualElementRenderer.SetElement((VisualElement)view);
            }
            else
            {
                base.SetVirtualView(view);
            }
        }