private void PanDetector_Detected(object source, PanGestureDetector.DetectedEventArgs e) { if (mode == Mode.EditMode) { return; } switch (e.PanGesture.State) { case Gesture.StateType.Finished: { int mouse_nextX = (int)e.PanGesture.ScreenPosition.X; int distance = mouse_nextX - panScreenPosition; if (distance > DRAG_DISTANCE) { rotarySelectorManager.NextPage(); } else if (distance < -DRAG_DISTANCE) { rotarySelectorManager.PrevPage(); } panScreenPosition = 0; break; } case Gesture.StateType.Continuing: break; case Gesture.StateType.Started: { panScreenPosition = (int)e.PanGesture.ScreenPosition.X; break; } } }
private void PanDetector_Detected(object source, PanGestureDetector.DetectedEventArgs e) { RotaryTouchController controller = rotarySelectorManager.GetRotaryTouchController(); if (mode == Mode.EditMode && controller.SelectedItem != null) { panScreenPosition = 0; rotarySelectorManager.IsPaging = false; return; } if (controller.IsProcessing || rotarySelectorManager.isAnimating() || !rotarySelectorManager.isDetector()) { panScreenPosition = 0; rotarySelectorManager.IsPaging = false; rotarySelectorManager.SetPanDetector(); return; } switch (e.PanGesture.State) { case Gesture.StateType.Finished: { int mouse_nextX = (int)e.PanGesture.ScreenPosition.X; int distance = mouse_nextX - panScreenPosition; if (distance > DRAG_DISTANCE) { rotarySelectorManager.NextPage(); } else if (distance < -DRAG_DISTANCE) { rotarySelectorManager.PrevPage(); } panScreenPosition = 0; rotarySelectorManager.IsPaging = false; break; } case Gesture.StateType.Continuing: break; case Gesture.StateType.Started: { rotarySelectorManager.IsPaging = true; panScreenPosition = (int)e.PanGesture.ScreenPosition.X; break; } } }