예제 #1
0
        private void panBegan(CGPoint point)
        {
            if (!isActive)
            {
                return;
            }

            allItemsStartAndEndTime = dataSource.AllItemsStartAndEndTime();

            firstPoint = point;
            LastPoint  = point;

            var cell           = CollectionView.CellForItem(itemIndexPath) as CalendarItemView;
            var topDragRect    = CollectionView.ConvertRectFromView(cell.TopDragTouchArea, cell);
            var bottomDragRect = CollectionView.ConvertRectFromView(cell.BottomDragTouchArea, cell);

            if (topDragRect.Contains(point))
            {
                action = EditAction.ChangeStartTime;
            }
            else if (bottomDragRect.Contains(point))
            {
                action = EditAction.ChangeEndTime;
            }
            else if (cell.Frame.Contains(point))
            {
                action = EditAction.ChangeOffset;
            }
            else
            {
                action = EditAction.None;
            }

            selectionFeedback.Prepare();
        }