Example #1
0
 public RendererToHandlerShim(IVisualElementRenderer visualElementRenderer) : this()
 {
     if (visualElementRenderer != null)
     {
         SetupRenderer(visualElementRenderer);
     }
 }
Example #2
0
        public void SetupRenderer(IVisualElementRenderer visualElementRenderer)
        {
            VisualElementRenderer = visualElementRenderer;
            VisualElementRenderer.ElementChanged += OnElementChanged;

            if (VisualElementRenderer.Element is IView view)
            {
                view.Handler = this;
                SetVirtualView(view);
            }
            else if (VisualElementRenderer.Element != null)
            {
                throw new Exception($"{VisualElementRenderer.Element} must implement: {nameof(Xamarin.Platform.IView)}");
            }
        }