Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ManipulationMode explained

Can someone explain the meaning of manipulation modes such as TranslateX, TranslateRailsX, TranslateInertia ? What is a rail mode? And what inertia they are talking about?

like image 993
TOP KEK Avatar asked Apr 18 '14 12:04

TOP KEK


1 Answers

With rails - when the input processor detects whether the manipulation is mostly vertical or mostly horizontal it sticks to the respective axis when reporting translation delta/cumulative values. If not - it just allows to freely manipulate whatever you are manipulating. Rails flags have to be used in combination with the non-rails flags, so just TranslateRailsX doesn't work. You need both that and TranslateX to get anything going.

The TranslateInertia flag allows for simple handling for flicks or inertial rotations/scales in case of the other inertia flags. Basically if you add that flag to the TranslateX one for example and you do a quick flick gesture - you will keep getting the input events (ManipulationDelta) for a while even after the gesture is completed. You also get the ManipulationInertiaStarting event when you flick once the input stream ends, so you get to control how far the flick goes if you want to. You can check out my extensions to the argument of that event in WinRT XAML Toolkit to get some more control over the ballistics of the flick too.

Your ManipulationDeltaEventArgs have an IsIntertial property you can also use to check if the events you are getting are directly from input events or a result of a flick and also call Complete() if for some reason you don't want to continue getting the delta events for the flick.

like image 132
Filip Skakun Avatar answered Oct 07 '22 23:10

Filip Skakun