protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                Element.PropertyChanged -= HandlePropertyChanged;

                if (_tapGesture != null)
                {
                    if (_clickOffView != null && _clickOffView.GestureRecognizers.Contains(_panGesture))
                    {
                        ((IList)_clickOffView.GestureRecognizers).Remove(_tapGesture);
                        _clickOffView.Dispose();
                    }
                    _tapGesture.Dispose();
                }
                if (_panGesture != null)
                {
                    if (View != null && View.GestureRecognizers.Contains(_panGesture))
                    {
                        ((IList)View.GestureRecognizers).Remove(_panGesture);
                    }
                    _panGesture.Dispose();
                }

                EmptyContainers();

                _disposed = true;
            }

            base.Dispose(disposing);
        }
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                Element.SizeChanged     -= PageOnSizeChanged;
                Element.PropertyChanged -= HandlePropertyChanged;

                if (_tapGesture != null)
                {
                    if (_clickOffView != null && _clickOffView.GestureRecognizers.Contains(_tapGesture))
                    {
                        _clickOffView.GestureRecognizers.Remove(_tapGesture);
                        _clickOffView.Dispose();
                    }
                    _tapGesture.Dispose();
                }
                if (_panGesture != null)
                {
                    if (View != null && View.GestureRecognizers.Contains(_panGesture))
                    {
                        View.GestureRecognizers.Remove(_panGesture);
                    }
                    _panGesture.Dispose();
                }

                EmptyContainers();

                Page.SendDisappearing();

                _disposed = true;
            }

            base.Dispose(disposing);
        }
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         _leftSwipeGesture?.Dispose();
         _rightSwipeGesture?.Dispose();
         _upSwipeGesture?.Dispose();
         _downSwipeGesture?.Dispose();
         _panGestureRecognizer?.Dispose();
         _leftSwipeGesture     = null;
         _rightSwipeGesture    = null;
         _upSwipeGesture       = null;
         _downSwipeGesture     = null;
         _panGestureRecognizer = null;
     }
     base.Dispose(disposing);
 }
        protected override void Dispose(bool disposing)
        {
            if (disposing && !_disposed)
            {
                Element.SizeChanged     -= PageOnSizeChanged;
                Element.PropertyChanged -= HandlePropertyChanged;

                if (_tracker != null)
                {
                    _tracker.Dispose();
                    _tracker = null;
                }

                if (_events != null)
                {
                    _events.Dispose();
                    _events = null;
                }


                if (_panGesture != null)
                {
                    if (View != null && View.GestureRecognizers.Contains(_panGesture))
                    {
                        View.RemoveGestureRecognizer(_panGesture);
                    }
                    _panGesture.Dispose();
                }

                EmptyContainers();

                PageController.SendDisappearing();

                _disposed = true;
            }

            base.Dispose(disposing);
        }
        private void RemoveGestureRecognizer()
        {
            if (_longPressGestureRecognizer != null)
            {
                RemoveGestureRecognizer(_longPressGestureRecognizer);

                _longPressGestureRecognizer.Dispose();
                _longPressGestureRecognizer = null;
            }
            if (_pinchGestureRecognizer != null)
            {
                RemoveGestureRecognizer(_pinchGestureRecognizer);

                _pinchGestureRecognizer.Dispose();
                _pinchGestureRecognizer = null;
            }
            if (_panGestureRecognizer != null)
            {
                RemoveGestureRecognizer(_panGestureRecognizer);

                _panGestureRecognizer.Dispose();
                _panGestureRecognizer = null;
            }
            if (_swipeGestureRecognizer != null)
            {
                RemoveGestureRecognizer(_swipeGestureRecognizer);

                _swipeGestureRecognizer.Dispose();
                _swipeGestureRecognizer = null;
            }
            if (_rotationGestureRecognizer != null)
            {
                RemoveGestureRecognizer(_rotationGestureRecognizer);

                _rotationGestureRecognizer.Dispose();
                _rotationGestureRecognizer = null;
            }
        }
Exemple #6
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (Element != null)
                {
                    Element.OpenRequested  -= OnOpenRequested;
                    Element.CloseRequested -= OnCloseRequested;
                }

                if (_scrollParent != null)
                {
                    if (_scrollParent is ScrollView scrollView)
                    {
                        scrollView.Scrolled -= OnParentScrolled;
                    }

                    if (_scrollParent is ListView listView)
                    {
                        listView.Scrolled -= OnParentScrolled;
                    }

                    if (_scrollParent is CollectionView collectionView)
                    {
                        collectionView.Scrolled -= OnParentScrolled;
                    }
                }

                if (_tapGestureRecognizer != null)
                {
                    Control.RemoveGestureRecognizer(_tapGestureRecognizer);
                    _tapGestureRecognizer.Dispose();
                    _tapGestureRecognizer = null;
                }

                if (_panGestureRecognizer != null)
                {
                    Control.RemoveGestureRecognizer(_panGestureRecognizer);
                    _panGestureRecognizer.Dispose();
                    _panGestureRecognizer = null;
                }

                if (_contentView != null)
                {
                    _contentView.Dispose();
                    _contentView = null;
                }

                if (_actionView != null)
                {
                    _actionView.Dispose();
                    _actionView = null;
                }

                if (_swipeItemsRect != null)
                {
                    _swipeItemsRect.Clear();
                    _swipeItemsRect = null;
                }
            }

            _isDisposed = true;

            base.Dispose(disposing);
        }