Search code examples
c#windows-phone-8.1gesture-recognition

Stop manipulation inertia in Windows phone 8.1


I have an element that I can slide using Manipulation events and element translation. I also set ManipulationMode to the value All, so inertia is included. My goal is to be able to stop the inertia translation after I removed my finger from the screen while sliding.

I found this interesting article but I could not find what I'm looking for: http://msdn.microsoft.com/library/windows/apps/windows.ui.input.gesturerecognizer.aspx?cs-save-lang=1&cs-lang=csharp#code-snippet-2

I'm sorry if the question is not very accurate but I'm on phone. Thanks in advance.


Solution

  • This is how I stop inertia in my app I'll manipulate using GestureRecognizer class

    Here is a sample to do manipulations with gesture recognizer Input: Gestures and manipulations with GestureRecognizer

    The above sample code also works with WP8.1 Remove inertia supported modes from GestureSettings. Thats it, there will be no inertia while you manipulate. Remove these three..

    Windows.UI.Input.GestureSettings.ManipulationTranslateInertia | 
    Windows.UI.Input.GestureSettings.ManipulationRotateInertia |
    Windows.UI.Input.GestureSettings.ManipulationScaleInertia