Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8493253
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T22:57:12+00:00 2026-06-10T22:57:12+00:00

Can anyone explain on how to detect simple touch gestures in a WinRT app?

  • 0

Can anyone explain on how to detect simple touch gestures in a WinRT app? I tried using the GestureRecognizer class but it didn’t work:

    public MainPage()
    {
        this.InitializeComponent();
        Windows.UI.Input.GestureRecognizer gr = new Windows.UI.Input.GestureRecognizer();
        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 gr_Tapped(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.TappedEventArgs args)
    {
        Debug.WriteLine("gr_Tapped");
    }
    void gr_RightTapped(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.RightTappedEventArgs args)
    {
        Debug.WriteLine("gr_RightTapped");
    }
    void gr_Holding(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.HoldingEventArgs args)
    {
        Debug.WriteLine("gr_Holding");
    }
    void gr_Dragging(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.DraggingEventArgs args)
    {
        Debug.WriteLine("gr_Dragging");
    }
    void gr_CrossSliding(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.CrossSlidingEventArgs args)
    {
        Debug.WriteLine("gr_CrossSliding");
    }
    void gr_ManipulationUpdated(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.ManipulationUpdatedEventArgs args)
    {
        Debug.WriteLine("gr_ManipulationUpdated");
    }
    void gr_ManipulationStarted(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.ManipulationStartedEventArgs args)
    {
        Debug.WriteLine("gr_ManipulationStarted");
    }
    void gr_ManipulationCompleted(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.ManipulationCompletedEventArgs args)
    {
        Debug.WriteLine("gr_ManipulationCompleted");
    }
    void gr_ManipulationInertiaStarting(Windows.UI.Input.GestureRecognizer sender, Windows.UI.Input.ManipulationInertiaStartingEventArgs args)
    {
        Debug.WriteLine("gr_ManipulationInertiaStarting");
    }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T22:57:13+00:00Added an answer on June 10, 2026 at 10:57 pm

    If you will notice the MainPage Class has its own Manipulation Events which you can use without creating a seperate GestureRecognizer. You can enable it by setting this.ManipulationMode to ManipulationModes.All. This will allow you to see responses on the MainPages Tapped, RightTapped, ManipulationStarting, ManipulationStarted, ManipulationDelta and ManipulationCompleted Events.

    As far as getting the GestureRecongnizer to work according to this Blog and this MSDN Forum Posting you will need to handle the MainPage’s PointerMoved, PointerReleased and PointerPressed events like so.

    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 && ps.Count > 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 && ps.Count > 0)
        {
            gr.ProcessDownEvent(ps[0]);
            e.Handled = true;
        }
    }
    

    According to the Documentation you need to enable the CrossSlide Event by adding it to your GestureRecongnizer and setting up the CrossSlideThresholds and Direction.
    From last link:

    CrossSlide must be set in the GestureSettings property to support CrossSliding.
    CrossSliding distance thresholds are disabled by default. Use CrossSlideThresholds to set these values.

    example:

    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;
    

    and make sure it is added to your GestureSettings

    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;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Can anyone explain the pros and cons to using Data.Text and Data.ByteString.Char8 data types?
can anyone explain me what happen here?? i have this html code: <div class=calculadora>
Can anyone explain why mysql_close() fails when called from a class destructor? mysql_error() reports
Can anyone explain in simple words what First and Second Level caching in Hibernate/NHibernate
Can anyone explain what advantages there are to using a tool like MSBuild (or
Can anyone explain to me why this program: for(float i = -1; i <
Can anyone explain why here a = [] ? 1 : 2 a will
Can anyone explain me how to overpass these problems? Description Resource Path Location Type
Can anyone explain to me why there is a dramatic difference in performance between
Can anyone explain to me why, in VBA code for a button on a

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.