コード例 #1
0
        protected override void OnDetached()
        {
            base.OnDetached();

            _view.RemoveGestureRecognizer(_tapGesture);
            _tapGesture.Dispose();
            _tapGesture = null;

            if (_longTapGesture != null)
            {
                _view.RemoveGestureRecognizer(_longTapGesture);
                _longTapGesture.Dispose();
                _longTapGesture = null;
            }

            if (_command != null)
            {
                _command.CanExecuteChanged -= CommandCanExecuteChanged;
            }

            if (_longCommand != null)
            {
                _longCommand.CanExecuteChanged -= CommandCanExecuteChanged;
            }

            _command              = null;
            _longCommand          = null;
            _commandParameter     = null;
            _longCommandParameter = null;

            _view = null;

            System.Diagnostics.Debug.WriteLine($"Detached {GetType().Name} from {Element.GetType().FullName}");
        }
コード例 #2
0
        protected override void OnDetached()
        {
            _view.RemoveGestureRecognizer(_tapGesture);
            _tapGesture.Dispose();

            if (_longTapGesture != null)
            {
                _view.RemoveGestureRecognizer(_longTapGesture);
                _longTapGesture.Dispose();
            }

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

            if (_command != null)
            {
                _command.CanExecuteChanged -= CommandCanExecuteChanged;
            }

            if (_longCommand != null)
            {
                _longCommand.CanExecuteChanged -= CommandCanExecuteChanged;
            }

            _clickSound?.Dispose();
        }
コード例 #3
0
 public override void ViewDidUnload()
 {
     base.ViewDidUnload();
     tagLongPress.Dispose();
     tagTap.Dispose();
     _webViewObserver?.Dispose();
 }
コード例 #4
0
        protected override void Dispose(bool disposing)
        {
            if (_disposed)
            {
                return;
            }

            _disposed = true;

            if (disposing)
            {
                if (Element != null)
                {
                    var mapModel = (Map)Element;
                    MessagingCenter.Unsubscribe <Map, MapSpan>(this, MoveMessageName);
                    ((ObservableCollection <Pin>)mapModel.Pins).CollectionChanged -= OnPinCollectionChanged;
                    ((ObservableCollection <MapElement>)mapModel.MapElements).CollectionChanged -= OnMapElementCollectionChanged;
                    foreach (Pin pin in mapModel.Pins)
                    {
                        pin.PropertyChanged -= PinOnPropertyChanged;
                    }
                }

                var mkMapView = (MKMapView)Control;
                mkMapView.DidSelectAnnotationView -= MkMapViewOnAnnotationViewSelected;
                mkMapView.RegionChanged           -= MkMapViewOnRegionChanged;
                mkMapView.GetViewForAnnotation     = null;
                mkMapView.OverlayRenderer          = null;
                if (mkMapView.Delegate != null)
                {
                    mkMapView.Delegate.Dispose();
                    mkMapView.Delegate = null;
                }
                mkMapView.RemoveFromSuperview();
#if __MOBILE__
                mkMapView.RemoveGestureRecognizer(_mapClickedGestureRecognizer);
                _mapClickedGestureRecognizer.Dispose();
                _mapClickedGestureRecognizer = null;

                if (FormsMaps.IsiOs9OrNewer)
                {
                    // This renderer is done with the MKMapView; we can put it in the pool
                    // for other rendererers to use in the future
                    MapPool.Add(mkMapView);
                }
#endif
                // For iOS versions < 9, the MKMapView will be disposed in ViewRenderer's Dispose method

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

                _lastTouchedView = null;
            }

            base.Dispose(disposing);
        }
コード例 #5
0
ファイル: CardFront.cs プロジェクト: seasiainfotech/Slink
 protected override void Dispose(bool disposing)
 {
     base.Dispose(disposing);
     if (disposing)
     {
         CollectionViewTapGesture?.Dispose();
         CollectionViewTapGesture = null;
     }
 }
コード例 #6
0
ファイル: MapCell.cs プロジェクト: showmap/smartwalk
 private void DisposeGestures()
 {
     if (_mapTapGesture != null)
     {
         CoverView.RemoveGestureRecognizer(_mapTapGesture);
         _mapTapGesture.Dispose();
         _mapTapGesture = null;
     }
 }
コード例 #7
0
 private void DisposeGestures()
 {
     if (_cellTapGesture != null)
     {
         ContainerView.RemoveGestureRecognizer(_cellTapGesture);
         _cellTapGesture.Dispose();
         _cellTapGesture = null;
     }
 }
コード例 #8
0
 private void DisposeGestures()
 {
     if (_searchTableTapGesture != null)
     {
         SearchTableView.RemoveGestureRecognizer(_searchTableTapGesture);
         _searchTableTapGesture.Dispose();
         _searchTableTapGesture = null;
     }
 }
コード例 #9
0
ファイル: ListViewBase.cs プロジェクト: showmap/smartwalk
 private void DisposeGesture()
 {
     if (_viewTapGesture != null)
     {
         View.RemoveGestureRecognizer(_viewTapGesture);
         _viewTapGesture.Dispose();
         _viewTapGesture = null;
     }
 }
コード例 #10
0
 protected override void OnDetached()
 {
     mapView.RemoveGestureRecognizer(tapGesture);
     tapGesture.Dispose();
     tapGesture = null;
     longPressGesture.Dispose();
     longPressGesture = null;
     mapView          = null;
     behavior         = null;
 }
コード例 #11
0
        public override void ViewDidUnload()
        {
            base.ViewDidUnload();

            View.RemoveGestureRecognizer(_tapGesutre);
            _tapGesutre.Dispose();
            _tapGesutre = null;
            _source.Dispose();
            _tableView.Dispose();
        }
コード例 #12
0
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            _hitArea.RemoveGestureRecognizer(_gesture);
            _overlay.RemoveFromSuperview();

            _gesture.Dispose();
            _gesture = null;
        }
コード例 #13
0
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            if (TapGestureRecognizerToHideDrawer != null)
            {
                View.Window.RemoveGestureRecognizer(TapGestureRecognizerToHideDrawer);
                TapGestureRecognizerToHideDrawer.Dispose();
                TapGestureRecognizerToHideDrawer = null;
            }
        }
コード例 #14
0
        protected override void Dispose(bool disposing)
        {
            base.Dispose(disposing);
            if (disposing)
            {
                TapGestureRecognizerToHideDrawer?.Dispose();
                TapGestureRecognizerToHideDrawer = null;

                TableViewController?.Dispose();
                TableViewController = null;
            }
        }
コード例 #15
0
        protected override void Dispose(bool disposing)
        {
            if (disposing)
            {
                if (_tapGesture != null)
                {
                    this.RemoveGestureRecognizer(_tapGesture);
                    _tapGesture?.Dispose();
                    _tapGesture = null;
                }
            }

            base.Dispose(disposing);
        }
コード例 #16
0
        private void DisposeGestures()
        {
            if (_headerImageTapGesture != null)
            {
                ImageBackground.RemoveGestureRecognizer(_headerImageTapGesture);
                _headerImageTapGesture.Dispose();
                _headerImageTapGesture = null;
            }

            if (_descriptionTapGesture != null)
            {
                DescriptionLabel.RemoveGestureRecognizer(_descriptionTapGesture);
                _descriptionTapGesture.Dispose();
                _descriptionTapGesture = null;
            }
        }
コード例 #17
0
        private void CleanupResources()
        {
            if (_gestureRecognizer != null)
            {
                _animationView?.RemoveGestureRecognizer(_gestureRecognizer);
                _gestureRecognizer.Dispose();
                _gestureRecognizer = null;
            }

            if (_animationView != null)
            {
                _animationView.RemoveFromSuperview();
                _animationView.Dispose();
                _animationView = null;
            }
        }
コード例 #18
0
ファイル: VenueShowCell.cs プロジェクト: showmap/smartwalk
        private void DisposeGestures()
        {
            if (_cellTapGesture != null)
            {
                RemoveGestureRecognizer(_cellTapGesture);
                _cellTapGesture.Dispose();
                _cellTapGesture = null;
            }

            if (_starTapGesture != null)
            {
                StarButton.RemoveGestureRecognizer(_starTapGesture);
                _starTapGesture.Dispose();
                _starTapGesture = null;
            }
        }
コード例 #19
0
        private void DisposeGestures()
        {
            if (_mapTapGesture != null)
            {
                NavigateOnMapButton.RemoveGestureRecognizer(_mapTapGesture);
                _mapTapGesture.Dispose();
                _mapTapGesture = null;
            }

            if (_cellPressGesture != null)
            {
                RemoveGestureRecognizer(_cellPressGesture);
                _cellPressGesture.Dispose();
                _cellPressGesture = null;
            }
        }
コード例 #20
0
        void ClearCloserRecognizer(ContextActionsCell cell)
        {
            if (_globalCloser == null || _globalCloser.State == UIGestureRecognizerState.Cancelled)
            {
                return;
            }

            cell?.ContentCell?.RemoveGestureRecognizer(_closer);
            _closer.Dispose();
            _closer = null;

            _table.RemoveGestureRecognizer(_globalCloser);
            _table = null;
            _globalCloser.Dispose();
            _globalCloser = null;
        }
コード例 #21
0
        protected override void OnDetached()
        {
            _view.RemoveGestureRecognizer(_tapGesture);
            _tapGesture.Dispose();

            if (_longTapGesture != null)
            {
                _view.RemoveGestureRecognizer(_longTapGesture);
                _longTapGesture.Dispose();
            }

            if (_layer != null)
            {
                _layer.Dispose();
                _layer = null;
            }
        }
コード例 #22
0
        void ClearCloserRecognizer(UIScrollView scrollView)
        {
            if (_globalCloser == null || _globalCloser.State == UIGestureRecognizerState.Cancelled)
            {
                return;
            }

            var cell = GetContextCell(scrollView);

            cell.RemoveGestureRecognizer(_closer);
            _closer.Dispose();
            _closer = null;

            _table.RemoveGestureRecognizer(_globalCloser);
            _table = null;
            _globalCloser.Dispose();
            _globalCloser = null;
        }
コード例 #23
0
        private void AllowCloseImageByTapping()
        {
            UITapGestureRecognizer onTapDismissController = null;

            // Allow the controller to be dismissed by
            // just tapping the image. Convenient, huh?
            onTapDismissController = new UITapGestureRecognizer(_ =>
            {
                imageView.RemoveGestureRecognizer(onTapDismissController);
                onTapDismissController.Dispose();
                onTapDismissController = null;

                DismissViewController(true, null);
            });

            onTapDismissController.NumberOfTapsRequired = 1;
            imageView.AddGestureRecognizer(onTapDismissController);
        }
コード例 #24
0
        public override void ViewWillDisappear(bool animated)
        {
            base.ViewWillDisappear(animated);

            _gesture.Dispose();
            _gesture = null;

            _autoScrollHelper.Dispose();
            _autoScrollHelper = null;

            for (var i = 0; i < _contentView.Subviews.Count(); i++)
            {
                var textField = _contentView.Subviews[i] as UITextField;
                if (textField != null)
                {
                    textField.ShouldReturn = null;
                }
            }
        }
コード例 #25
0
 protected override void Dispose(bool disposing)
 {
     if (disposing)
     {
         if (_swipeDown != null)
         {
             _swipeDown.Dispose();
             _swipeDown = null;
         }
         if (_swipeLeft != null)
         {
             _swipeLeft.Dispose();
             _swipeLeft = null;
         }
         if (_swipeRight != null)
         {
             _swipeRight.Dispose();
             _swipeRight = null;
         }
         if (_swipeUp != null)
         {
             _swipeUp.Dispose();
             _swipeUp = null;
         }
         if (_doubleTap != null)
         {
             _doubleTap.Dispose();
             _doubleTap = null;
         }
         if (_singleTap != null)
         {
             _singleTap.Dispose();
             _singleTap = null;
         }
         if (_pinch != null)
         {
             _pinch.Dispose();
             _pinch = null;
         }
     }
     // don't try and dispose the base - it will try and dispose of the native control that we didn't create
     //base.Dispose(disposing);
 }
コード例 #26
0
        private void DisposeGestures()
        {
            if (_singleTapRecognizer != null)
            {
                ScrollView.RemoveGestureRecognizer(_singleTapRecognizer);
                _singleTapRecognizer.Dispose();
                _singleTapRecognizer = null;
            }

            if (_doubleTapRecognizer != null)
            {
                ScrollView.RemoveGestureRecognizer(_doubleTapRecognizer);
                _doubleTapRecognizer.Dispose();
                _doubleTapRecognizer = null;
            }

            if (_swipeRecognizer != null)
            {
                View.RemoveGestureRecognizer(_swipeRecognizer);
                _swipeRecognizer.Dispose();
                _swipeRecognizer = null;
            }
        }
コード例 #27
0
        protected override void Dispose(bool disposing)
        {
            if (_isDisposed)
            {
                return;
            }

            if (disposing)
            {
                if (Element != null)
                {
                    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 (_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);
        }
コード例 #28
0
 private void ReleaseKeyboardTap()
 {
     _keyboardTapGesture?.Dispose();
     _keyboardTapGesture = null;
 }
コード例 #29
0
 public override void ViewDidUnload()
 {
     base.ViewDidUnload();
     tapGesture.Dispose();
 }
コード例 #30
0
 public void Unbind(UIView view, UITapGestureRecognizer binding)
 {
     view.RemoveGestureRecognizer(binding);
     binding.Dispose();
     boundClickActions.Remove(view);
 }