Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>If you will notice the MainPage Class has its own Manipulation Events which you can use without creating a seperate <code>GestureRecognizer</code>. You can enable it by setting <code>this.ManipulationMode</code> to <code>ManipulationModes.All</code>. This will allow you to see responses on the MainPages <code>Tapped</code>, <code>RightTapped</code>, <code>ManipulationStarting</code>, <code>ManipulationStarted</code>, <code>ManipulationDelta</code> and <code>ManipulationCompleted</code> Events. </p> <p>As far as getting the GestureRecongnizer to work according to this <a href="http://through-the-interface.typepad.com/through_the_interface/winrt/" rel="noreferrer">Blog</a> and this <a href="http://social.msdn.microsoft.com/Forums/en-US/winappswithcsharp/thread/0dad4881-da1c-4db9-be8d-a9324a233662" rel="noreferrer">MSDN Forum Posting</a> you will need to handle the MainPage's <code>PointerMoved</code>, <code>PointerReleased</code> and <code>PointerPressed</code> events like so.</p> <pre><code>Windows.UI.Input.GestureRecognizer gr = new Windows.UI.Input.GestureRecognizer(); public MainPage() { this.InitializeComponent(); this.PointerPressed += MainPage_PointerPressed; this.PointerMoved += MainPage_PointerMoved; this.PointerReleased += MainPage_PointerReleased; gr.CrossSliding += gr_CrossSliding; gr.Dragging += gr_Dragging; gr.Holding += gr_Holding; gr.ManipulationCompleted += gr_ManipulationCompleted; gr.ManipulationInertiaStarting += gr_ManipulationInertiaStarting; gr.ManipulationStarted += gr_ManipulationStarted; gr.ManipulationUpdated += gr_ManipulationUpdated; gr.RightTapped += gr_RightTapped; gr.Tapped += gr_Tapped; gr.GestureSettings = Windows.UI.Input.GestureSettings.ManipulationRotate | Windows.UI.Input.GestureSettings.ManipulationTranslateX | Windows.UI.Input.GestureSettings.ManipulationTranslateY | Windows.UI.Input.GestureSettings.ManipulationScale | Windows.UI.Input.GestureSettings.ManipulationRotateInertia | Windows.UI.Input.GestureSettings.ManipulationScaleInertia | Windows.UI.Input.GestureSettings.ManipulationTranslateInertia | Windows.UI.Input.GestureSettings.Tap; } void MainPage_PointerReleased(object sender, PointerRoutedEventArgs e) { var ps = e.GetIntermediatePoints(null); if (ps != null &amp;&amp; ps.Count &gt; 0) { gr.ProcessUpEvent(ps[0]); e.Handled = true; gr.CompleteGesture(); } } void MainPage_PointerMoved(object sender, PointerRoutedEventArgs e) { gr.ProcessMoveEvents(e.GetIntermediatePoints(null)); e.Handled = true; } void MainPage_PointerPressed(object sender, PointerRoutedEventArgs e) { var ps = e.GetIntermediatePoints(null); if (ps != null &amp;&amp; ps.Count &gt; 0) { gr.ProcessDownEvent(ps[0]); e.Handled = true; } } </code></pre> <hr> <p>According to the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/hh465299.aspx" rel="noreferrer">Documentation</a> you need to enable the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.input.gesturerecognizer.crosssliding.aspx" rel="noreferrer">CrossSlide</a> Event by adding it to your GestureRecongnizer and setting up the <a href="http://msdn.microsoft.com/en-us/library/windows/apps/windows.ui.input.crossslidethresholds.aspx" rel="noreferrer">CrossSlideThresholds</a> and Direction. From last link:</p> <blockquote> <p>CrossSlide must be set in the GestureSettings property to support CrossSliding. CrossSliding distance thresholds are disabled by default. Use CrossSlideThresholds to set these values.</p> </blockquote> <p>example:</p> <pre><code>Windows.UI.Input.CrossSlideThresholds cst = new Windows.UI.Input.CrossSlideThresholds(); cst.SelectionStart = 2; cst.SpeedBumpStart = 3; cst.SpeedBumpEnd = 4; cst.RearrangeStart = 5; gr.CrossSlideHorizontally = true; gr.CrossSlideThresholds = cst; gr.CrossSliding += gr_CrossSliding; </code></pre> <p>and make sure it is added to your <code>GestureSettings</code></p> <pre><code>gr.GestureSettings = Windows.UI.Input.GestureSettings.ManipulationRotate | Windows.UI.Input.GestureSettings.ManipulationTranslateX | Windows.UI.Input.GestureSettings.ManipulationScale | Windows.UI.Input.GestureSettings.ManipulationRotateInertia | Windows.UI.Input.GestureSettings.ManipulationScaleInertia | Windows.UI.Input.GestureSettings.ManipulationTranslateInertia | Windows.UI.Input.GestureSettings.Tap | Windows.UI.Input.GestureSettings.CrossSlide; </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload