Erik
Erik

Reputation: 799

Get doubletap coordinates in c# windows phone 8

I'm trying my best to get the coordinates of where my finger doubletapped when i doubletapped somewhere on the canvas, how can i accomplish this? I have a doubletap method like this:

        private void App_DoubleTap(object sender, System.Windows.Input.GestureEventArgs e)
    {
        //Get coordinates(left and top) of where i doubletapped
    }

Please help me and thanks a lot in advance!:)

Upvotes: 0

Views: 587

Answers (1)

Benoit Catherinet
Benoit Catherinet

Reputation: 3345

To get the position relative to the page, use:

Point point=e.GetPosition(this);

To get the position relative to the canvas (with the double Tap event regitered on the Canvas), use:

point = e.GetPosition(sender as UIElement);

Upvotes: 1

Related Questions