//*****Recognizer Creation ******** private void addPanRecognizer() { PanGestureRecognizer = new MotionPanGetsureRecognizer(); PanGestureRecognizer.setMotionPanListener(this); PanGestureRecognizer.NumberOfFingersPerHandRequired = 1; PanGestureRecognizer.NumberOfHandsRequired = 1; PanGestureRecognizer.startListening(); }
private void addPanRecognizer() { MotionPanGetsureRecognizer PanGestureRecognizer = new MotionPanGetsureRecognizer(); PanGestureRecognizer.setMotionPanListener(this); PanGestureRecognizer.NumberOfFingersPerHandRequired = 1; PanGestureRecognizer.NumberOfHandsRequired = 1; PanGestureRecognizer.startListening(); }
public void motionDidPan(MotionPanGetsureRecognizer recognizer) { if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateBegan) { System.Console.WriteLine("Pan did Begin"); } else if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateChanged) { System.Console.WriteLine("Pan did Change x:" + recognizer.centerPoint.x + " y:" + recognizer.centerPoint.y + " z:" + recognizer.centerPoint.z); } else if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateEnded) { System.Console.WriteLine("Pan did End"); } }
public void motionDidPan(MotionPanGetsureRecognizer recognizer) { if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateBegan) { System.Console.WriteLine("Pan did Begin"); } else if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateChanged) { Point newPoint = MotionGestureRecognizer.locationOfVectorInWindow(recognizer.centerPoint, this, 2); Thickness t = new Thickness(newPoint.X, newPoint.Y, 100, 100); mainWindow.Dispatcher.BeginInvoke(DispatcherPriority.Background, new Action(() => this.mainCanvas.Margin = t)); } else if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateEnded) { System.Console.WriteLine("Pan did End"); } }
public void motionDidPan(MotionPanGetsureRecognizer recognizer) { if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateBegan) { System.Console.WriteLine("Pan did Begin"); } else if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateChanged) { System.Console.WriteLine("Pan did Change x:"+recognizer.centerPoint.x+" y:"+recognizer.centerPoint.y+" z:"+recognizer.centerPoint.z); } else if (recognizer.state == MotionGestureRecognizerState.MotionGestureRecognizerStateEnded) { System.Console.WriteLine("Pan did End"); } }