private void CreateShadowController(UIView shadowSource, Shadows formsElement)
        {
            Layer.BackgroundColor = new CGColor(0, 0, 0, 0);
            Layer.MasksToBounds   = false;

            _shadowsLayer = new CALayer {
                MasksToBounds = false
            };
            Layer.InsertSublayer(_shadowsLayer, 0);

            _shadowsController = new iOSShadowsController(shadowSource, _shadowsLayer, formsElement.CornerRadius);
            _shadowsController.UpdateShades(formsElement.Shades);
        }
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                _shadowsController?.Dispose();
                _shadowsController = null;

                _shadowsLayer?.Dispose();
                _shadowsLayer = null;
            }
        }
        private void CreateShadowController(UIView shadowSource, Shadows formsElement)
        {
            Layer.BackgroundColor = new CGColor(0, 0, 0, 0);
            Layer.MasksToBounds   = false;

            _shadowsLayer = new CALayer {
                MasksToBounds = false
            };
            Layer.InsertSublayer(_shadowsLayer, 0);

            _shadowsController = new iOSShadowsController(shadowSource, _shadowsLayer, formsElement.CornerRadius);
            _shadowsController.UpdateShades(formsElement.Shades);

            instanceCount++;
            InternalLogger.Debug(_tag, () => $"Create ShadowView => {instanceCount} instances");
        }
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);

            if (disposing)
            {
                _shadowsController?.Dispose();
                _shadowsController = null;

                _shadowsLayer?.Dispose();
                _shadowsLayer = null;
            }

            instanceCount--;

            InternalLogger.Debug(_tag, () => $"Disposed( disposing: {disposing} ) => {instanceCount} instances");
        }
        protected override void OnElementChanged(ElementChangedEventArgs <Shadows> e)
        {
            base.OnElementChanged(e);

            if (e.NewElement == null)
            {
                _shadowsController?.Dispose();
                _shadowsController = null;

                _shadowsLayer?.Dispose();
                _shadowsLayer = null;
                return;
            }

            if (_shadowsController == null && Subviews.Length > 0)
            {
                CreateShadowController(Subviews[0], e.NewElement);
            }
        }