protected override void HandleLongPressGesture() { switch (LongPressGestureRecognizer.State) { case UIGestureRecognizerState.Began: { // we try to grab the current seelected item and draw a floating copy of it on the Drag Surface // the copy is just an image of it using RasterizedImage var currentIndexPath = CollectionView.IndexPathForItemAtPoint(LongPressGestureRecognizer.LocationInView(CollectionView)); SelectedItemIndexPath = currentIndexPath; if (SelectedItemIndexPath == null) { return; } if (!DataSource.CanMoveItemAtIndexPath(SelectedItemIndexPath)) { return; } var collectionViewCell = CollectionView.CellForItem(SelectedItemIndexPath); var tpoint = DragSurface.ConvertPointFromView(collectionViewCell.Frame.Location, CollectionView); RectangleF frame = new RectangleF(tpoint.X, tpoint.Y, collectionViewCell.Frame.Size.Width, collectionViewCell.Frame.Size.Height); CurrentView = new UIView(frame); collectionViewCell.Highlighted = true; var highlightedImageView = new UIImageView(RastertizedImage(collectionViewCell)); highlightedImageView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; highlightedImageView.Alpha = 1.0f; collectionViewCell.Highlighted = false; var imageView = new UIImageView(RastertizedImage(collectionViewCell)); imageView.AutoresizingMask = UIViewAutoresizing.FlexibleWidth | UIViewAutoresizing.FlexibleHeight; imageView.Alpha = 0.0f; CurrentView.AddSubview(imageView); CurrentView.AddSubview(highlightedImageView); DragSurface.AddSubview(CurrentView); // add this to the top level view so that we can drag outside CurrentViewCenter = CurrentView.Center; OnWillBeginDraggingItem(SelectedItemIndexPath); // we animate the drawing out of the floating copy UIView.Animate(0.3, 0.0, UIViewAnimationOptions.BeginFromCurrentState, () => { CurrentView.Transform = CGAffineTransform.MakeScale(1.1f, 1.1f); highlightedImageView.Alpha = 0.0f; imageView.Alpha = 1.0f; }, () => { highlightedImageView.RemoveFromSuperview(); OnDidBegingDraggingItem(SelectedItemIndexPath); }); InvalidateLayout(); } break; case UIGestureRecognizerState.Cancelled: case UIGestureRecognizerState.Ended: { var currentIndexPath = SelectedItemIndexPath; if (currentIndexPath == null || CurrentView == null) { return; } SelectedItemIndexPath = null; CurrentViewCenter = PointF.Empty; OnWillEndDraggingItem(currentIndexPath); UIView.Animate(0.3, 0.0, UIViewAnimationOptions.BeginFromCurrentState, () => { var layoutAttributes = this.LayoutAttributesForItem(currentIndexPath); CurrentView.Transform = CGAffineTransform.MakeScale(1.0f, 1.0f); CurrentView.Center = CollectionView.ConvertPointToView(layoutAttributes.Center, DragSurface); }, () => { CurrentView.RemoveFromSuperview(); CurrentView = null; InvalidateLayout(); OnDidEndDraggingItem(currentIndexPath); }); } break; } }