Ejemplo n.º 1
0
        private void OnLongPressGestureDetected(object source, LongPressGestureDetector.DetectedEventArgs e)
        {
            switch (e.LongPressGesture.State)
            {
            case Gesture.StateType.Started:
            {
                Size      windowSize = NUIApplication.GetDefaultWindow().Size;
                ItemRange range      = new ItemRange(0, 0);
                mItemView.GetItemsRange(range);

                uint item = (e.LongPressGesture.ScreenPoint.Y < 0.5f * (float)windowSize.Height) ? range.begin : range.end;

                mItemView.ScrollToItem(item, SCROLL_TO_ITEM_ANIMATION_TIME);

                break;
            }

            case Gesture.StateType.Finished:
            {
                PropertyMap attributes = new PropertyMap();
                mItemView.DoAction("stopScrolling", attributes);
                break;
            }

            default:
            {
                break;
            }
            }
        }