Example #1
0
        protected override void OnElementChanged(ElementChangedEventArgs <TView> e)
        {
            if (Control == null)
            {
                SetNativeControl(new Native.Canvas(Forms.NativeParent));
                Control.Show();
                Control.LayoutUpdated += OnLayout;
                Control.Children.Add(RealNativeView);
            }

            _backgroundCanvas = new Lazy <SKCanvasView>(() =>
            {
                var canvas           = new SKCanvasView(Forms.NativeParent);
                canvas.PassEvents    = true;
                canvas.PaintSurface += OnBackgroundPaint;
                canvas.Show();
                Control.Children.Add(canvas);
                canvas.Lower();
                RealNativeView?.RaiseTop();
                return(canvas);
            });
            base.OnElementChanged(e);
        }
 protected void SetRealNativeControl(TNativeView control)
 {
     Debug.Assert(control != null);
     RealNativeView = control;
     RealNativeView.Show();
 }