protected override void OnAttached()
        {
            if (Container == null)
            {
                return;
            }

            _clickOverlay            = ViewOverlayCollector.Add(Container, this);
            _clickOverlay.Click     += ViewOnClick;
            _clickOverlay.LongClick += ViewOnLongClick;
        }
        protected override void OnDetached()
        {
            var renderer = Container as IVisualElementRenderer;

            if (renderer?.Element != null) // Check disposed
            {
                _clickOverlay.Click     -= ViewOnClick;
                _clickOverlay.LongClick -= ViewOnLongClick;

                ViewOverlayCollector.Delete(Container, this);
            }
        }
예제 #3
0
        protected override void OnDetached()
        {
            var renderer = Container as IVisualElementRenderer;

            if (renderer?.Element != null) // Check disposed
            {
                if (_viewOverlay != null)
                {
                    _viewOverlay.Touch -= OnTouch;
                }

                ViewOverlayCollector.Delete(Container, this);

                if (EnableRipple)
                {
                    RemoveRipple();
                }
            }
        }
예제 #4
0
        private void UpdateTapFeedbackColor()
        {
            _view = Control ?? Container;

            if (Control is Android.Widget.ListView)
            {
                //Except ListView because of Raising Exception OnClick
                return;
            }

            _viewOverlay = ViewOverlayCollector.Add(Container, this);

            if (EnableRipple)
            {
                AddRipple();
            }
            else
            {
                _viewOverlay.Touch += OnTouch;
            }

            UpdateEffectColor();
        }