How can I use GestureRecognizer in a Xaml based app?

I've encountered a problem when I'm trying to use gestures in my app:
I'm trying to retrieve info from input on a rectangle using GestureRecognizer responding to the PointerPressed event. When the user taps on it, the textblock shows information. However, I failed to get any info after following the code samples.
There was no response and through debugging, I found the tapped event was not responded to.
First, I added:
Platform::Agile<Windows::UI::Input::GestureRecognizer> m_gestureRecognizer;
in the header of the class.
And in the constructor:
MainPage::MainPage()
InitializeComponent();
m_gestureRecognizer = ref new GestureRecognizer();
m_gestureRecognizer->GestureSettings =
GestureSettings::DoubleTap | GestureSettings::Tap;
m_gestureRecognizer->Tapped += ref new Windows::Foundation::TypedEventHandler<Windows::UI::Input::GestureRecognizer ^, Windows::UI::Input::TappedEventArgs ^>(this, &App4::MainPage::OnTapped);
Next, I responded to the PointerPressed event:
void App4::MainPage::OnPressed(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
unsigned int id = e->Pointer->PointerId;//debug breakpoint
m_gestureRecognizer->ProcessDownEvent(Windows::UI::Input::PointerPoint::GetCurrentPoint(id));
e->Handled = true;
But when I came to the Tapped event, nothing happened:
void MainPage::OnTapped(GestureRecognizer^ gesrec, Windows::UI::Input::TappedEventArgs^ args)
int i = args->TapCount;//debug breakpoint
if (i == 2)
info->Text = "You double-tapped the point at X: " + args->Position.X + ", Y: " + args->Position.Y + ".";
else
info->Text = "You tapped the point X: " + args->Position.X + ", Y: " + args->Position.Y + ".";
Why there was no info when I tapped the rectangle? Do I lack of something in the code? 

Oh, it's very kind of you! Thank you so much and the problem has been solved by adding two handlers:
void App4::MainPage::OnMoved(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
m_gestureRecognizer->ProcessMoveEvents(e->GetIntermediatePoints(wpRect/*name of the rectangle*/));
void App4::MainPage::OnReleased(Platform::Object^ sender, Windows::UI::Xaml::Input::PointerRoutedEventArgs^ e)
m_gestureRecognizer->ProcessUpEvent(Windows::UI::Input::PointerPoint::GetCurrentPoint(e->Pointer->PointerId));
I've been haunted by this issue for days...

Similar Messages

  • How can I use a different Apple ID withthe App Store?

    When I access the App Store from my iPhone 3G it asks me to enter the password for an Apple ID.
    How can I use a different Apple ID with the App Store?

    It will use the account you are currently signed into with iTunes when you synced. So in iTunes, change your account, then sync. Then the iPhone will use that one.

  • HT204053 I have two Apple ID's and one I have used to purchase all my apps but now I want to use my other one. But I can not purchase my old apps with my other one. How can I use my other one to purchase apps?

    I can't remember why but I made two Apple ID's, one with a Gmail address and another with a Yahoo address. I have always used my Yahoo address Apple ID to purchase my apps but I have recently deactivated my Yahoo address. So now I want to start using my Gmail address Apple ID but I can't purchase any apps or even my old apps on my iPhone. How can I use and re-install apps through my Gmail address Apple ID on my iPhone? And is there a way to deactivate my Yahoo address Apple ID that I do not want to use anymore?

    Apple does not transfer content bought with one Apple ID to another Apple ID. Apple will not merge two Apple IDs.
    If most of your content was bought with the Yahoo! Apple ID but you now want the Gmail address for your Apple ID, the trick will be to change the address used for the Yahoo ID with the Gmail address. However, to do that you must first free the Gmail address from that other Apple ID. Use the instructions from Apple to substitute another address that is not used as an Apple ID for your Gmail address in the Apple ID with the Gmail address. Then, when the Gmail address is no longer used in an Apple ID, you can use the same instructions to substitute the Gmail address for the Yahoo address in the Apple ID with the Yahoo address.
    Changing the email address you use for your Apple ID -
    http://support.apple.com/kb/HT5621

  • How CAn I Use a URL variable in Flex App

    Let say the link to a web page embedding a flex 2.0 app is
    http://www.myname.com?name=Bruce
    and I need to use the URL.name variable in the Flex app.
    How can I access URL parameters inside my Flex app?
    Bruce

    You probably know by now but I though maybe a could actualy
    answer someone question.
    {Application.application.parameters.name)
    put that in mx:text and you can see the var "name"

  • The computer I use for Itunes only has XP so I can't use ICloud. My desktop has Vista so I can use it. But I don't want to lose all of what I have on my Iphone 4S and my two Ipads. How can I use the desktop and retain the apps, music, podcasts etc. I have

    The computer I use for Itunes (my laptop) only has XP so I can't use ICloud:(
    I have a desktop that operates using with Vista.
    I downloaded 10.5 and sought to sync my two iphones and two ipads with the desktop in order to use ICloud. However I got warning messages that if I synced with this computer that had none of my extensive library of apps, music, podcasts, etc. would be on it, I would lose it all.
    I did authorize the computer. I knew enough to do that but am terrified that I will lose everything that I have accumulated and still won't be able to use ICloud.
    Isn't there a way to do this? Shift my library FROM my devices to the desktop?
    Thanks

    This is a tedious solution, which is stupid!  And some users report an inability to reauthorize a computer after an "en masse” deauthorization.  I can’t believe Apple doesn’t provide a list or menu to find out which computers you’ve authorized! Obviously, APPLE knows (or else they couldn’t tell us how many computers we have authorized)--so why can’t they give us access to that information about our own computers??!!!
    And for an already-authorized computer with a hard drive that’s since been replaced and upgraded from Mavericks to Yosemite, would it be recognized as a “new computer” and require authorization? Would its previous incarnation (i.e., with the old hard drive and OS) be considered a separate computer? Some users report they can’t authorize a computer after an OS upgrade because of that. Can’t believe we have to do such a bass-ackwards kludge!

  • HT204266 How can i use my account to update an App that was purchased by another account??

    How can i cancel an account from my ipad store??
    Accordingly, how could i update my apps using my new account??
    For more clarification;
    I purchased my friend ipad with some applications that already downloaded before. I could use those apps &amp; games easily but when i need to update any, i couldn't because i have to have an App account.
    I created a new app account, now i can purchase &amp; download any app but i can't update an old App that was purchased through my friend account.
    Please take into your concederation that i don't want to delete the App &amp; redownload it as i don't want to miss my data registed before.
    Please advice

    Welcome to the Apple Community.
    You can't transfer purchases from one account to the other. Your friend had no right selling you the iPod with purchases on it made from his account.

  • How can i use itunes gift card on the app store ?

    i bought an iTunes gift card but i don't want to buy any videos or songs i want to buy apps or games so i don't know how..... can anybody tell me how i do this with my Idevice not with my labtop

    When you redeem an iTunes gift card it is simply added as credit to the Apple ID of your choice. Once it is on the account as credit it can be used for anything you can purchase with your Apple ID (apps, music, movies, rentals... Anything ).

  • I have a credit in the iTunes store but when i try to purchase an app, aim asked for credit card information.  How can I use my iTunes account to purchase apps?

    I have a credit in the iTunes store but when I try to purchase apps I am asked for credit card information
    Are there two separate stores.  How can I make purchases?

    same here but i cant purchase a movie or anything

  • How can I use footage shot with a phone app?

    I have shot footage on my phone using a filtered app called Majicam.  When I play it in premiere it plays as a green screen. Do I need to alter something about the footage in order for Premiere to recognise it? Please help.

    hi there.  when i converted the file to mp4 it worked.  so thanks for that!!  bit of a pain to have to do that with so much of my footage tho.  maybe i should change my app. 
    just one more question if you have the time. im new to premiere. my source monitor doesnt always play in real time.  it stops and starts a bit.  i have 2G ram macbook.  any idea why it might be happening?
    thanks so much again

  • How can we use Custom MessageBox in SelectionChangedEvent of LongListSelector for Windows Phone 8

    Dear Sir/Madam,
    How can we use Custom MessageBox in SelectionChangedEvent of LongListSelector for Windows Phone 8.
    Actually my problem is that When i am using Custom  MessageBox in SelectionChangedEvent of LongListSelector,when i am click Open(Left Button) it's working fine and navigated correctly,But when i am Click the No(Right Button) then it stayed in same page
    but all that page is in stuckup i mean that page is not working and not doing any event.
    My C#.net Code
    private async void userPageLongListSelector_SelectionChanged(object sender, SelectionChangedEventArgs e)
    if (e.AddedItems.Count > 0)
    if (userPageLongListSelector.SelectedItem == null)
    return;
    if (dbTenMin == null)
    dbTenMin = new Database(ApplicationData.Current.LocalFolder, "tenMInDBSchema.db");
    await dbTenMin.OpenAsync();
    var res = (sender as LongListSelector).SelectedItem as _10Min._10MinClass.minUserPages;
    var resIndex = (sender as LongListSelector).ItemsSource.IndexOf(userPageLongListSelector.SelectedItem);
    string selectedPageName = res.userPages.ToString();
    string selectedPageDesignUser = res.pageDesignUser.ToString();
    int selectedIndex = resIndex;
    CustomMessageBox messageBox = new CustomMessageBox()
    Caption = "Message...!",
    Message = "This form need offline datalist,Please load now.",
    LeftButtonContent = "Open",
    RightButtonContent = "No"
    messageBox.Dismissed += (s1, e1) =>
    switch (e1.Result)
    case CustomMessageBoxResult.LeftButton:
    string uidAndpwd = _10MinClass._10MinStaticClass.csUidAndPwd.ToString();
    _10MinClass._10MinStaticClass.csDataListPageDetails = selectedPageDataDetailsForSchema.ToString();
    _10MinClass._10MinStaticClass.csAllDataLists = offlineDataBaseDataListNam;
    _10MinClass._10MinStaticClass.csNotCreatedSchemaNameOfDBList = notCreatedDataLists;
    userPageLongListSelector.SelectedItem = null;
    if (dbTenMin != null)
    dbTenMin.Dispose();
    dbTenMin = null;
    NavigationService.Navigate(new Uri("/10MinformDataList.xaml", UriKind.Relative));
    else
    NavigationService.Navigate(new Uri("/10MinformDataList.xaml", UriKind.Relative));
    break;
    case CustomMessageBoxResult.RightButton:
    break;
    case CustomMessageBoxResult.None:
    break;
    default:
    break;
    messageBox.Show();
    Same custom messagebox code working in Phone_BackKeyPress event i am writing the code in Right Button that e.OriginalSource.ToString(); then it is working fine.
    But It is not working in Selection Changed Event in LongListSelector control in Windows Phone 8.
    Please help me,as soon as possible.
    Thanks & Regards,
    SrinivaaS.

    What happens if you leave the implementation for LeftButton empty as well , does the page gets stuck in that case also, if you press left button?
    i.e.
    CustomMessageBox messageBox = new CustomMessageBox()
    Caption = "Message...!",
    Message = "This form need offline datalist,Please load now.",
    LeftButtonContent = "Open",
    RightButtonContent = "No"
    messageBox.Dismissed += (s1, e1) =>
    switch (e1.Result)
    case CustomMessageBoxResult.LeftButton:
    break;
    case CustomMessageBoxResult.RightButton:
    break;
    case CustomMessageBoxResult.None:
    break;
    default:
    break;
    messageBox.Show();
    http://developer.nokia.com/community/wiki/Using_Crypto%2B%2B_library_with_Windows_Phone_8

  • How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes?

    How can I use 2 Apple IDs in Itunes? I have 2 IOS Devices. They each have there own AppleID. What is the proper way to sync both of them to Itunes? I wanted my teenager's AppleID to be different from mine so that she couldn't charge stuff to my AppleID, therefore I created me another one. Now when I go to Sync either device, it tells me that this IOS device can only be synced with one AppleID. Then I get a message to erase it, not going to do that, lol. If I logout as one ID and login as the other, will it still retain all synced information on the PC from the first IOS device? If I can just log in out of the AppleID, then I have no problem doing that as long as the synced apps, music, etc stays there for both. I am not trying to copy from one to the other, just want to make sure I have a backup for the UhOh times. If logging in and out on the same PC of multiple AppleIDs is acceptible then I need to be able to authorize the PC for both devices. Thanks for the help. I am new to the iOS world.

    "Method Three
    Create a separate iTunes library for each device. Note:It is important that you make a new iTunes Library file. Do not justmake a copy of your existing iTunes Library file. If iTunes is open,quit it.
    This one may work. I searched and searched on the website for something like this, I guess I just didn't search correctly, lol. I will give this a try later. My daughter is not be back for a few weekends, therefore I will have to try the Method 3 when she comes back for the weekend again. "
    I forgot to mention that she has a PC at her house that she also syncs to. Would this cause a problem. I am already getting that pop up saying that the iPod is synced to another library (even though she is signed in with her Apple ID to iTunes) and gives the pop up to Cancel, Erase & Sync, or Transfer Purchases. My question arose because she clicked on "Erase & Sync" by mistake when she plugged the iPod to her PC the first time. When the iPod was purchased and setup, it was synced to my PC first. When she went home, she hooked it up to her PC and then she erased it by accident. I was able to restore all the missing stuff yesterday using my PC. However, even after doing that it still told me the next time I hooked it up last night that the iPod was currently synced with a different library. Hopefully, you can help me understand all this. She wants to sync her iPod and also backup her iPod at both places. Both PCs have been authorised. Thanks

  • How can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    how can i use my account without the billing info, as i do not have a credit card. and my shipping and billing info is under US. i'm in singapore. how do i change this?

    If you are just visiting Singapore, then leave the account as it is. If you have moved there, then view your account using the iTunes app on a Mac or PC and change the country/region to your current location and address. If you do not have a bank card, you can fund your account using iTunes gift cards if available in Singapore.

  • How can I use the webcam on my iPad 2 in the photon app

    I Have an ipad2 and use the photon app to access the webinar training my company provides I have been asked to do some traing but my iPad webcam does seem to work in the app is there a solution to this
    i also have an iPhone 6 if this helps
    many thanks Dot

    Hi Meg
    i use the photon app to access live training i have been asked to do some training and need to know if i can use the camera on my ipad 2 as a web cam  and also how can i set up a microphone within the app
    i cant  seem to find an external device for ipad nor  can i get the photon app to regognise the camera or microphone on my  ipad2
    is there a way to do this please

  • How can I use one photo twice in a slideshow

    I am in iPhoto '11 9.4.3 making a slideshow to send to iDVD for my mother-in-laws funeral next Wednesday.
    How can I use this one particular photo of her several times in the slide show.
    I have tried copy/past and that does not seem to work.
    Thanx in advance

    I would just duplicate the picture several times and keep inserting duplicates ...

  • How can i use microsoft word on ipad 2

    how can i use the microsoft application on my ipad 2?

    The Pages app is also compatible with MS Word. Unlike some of the others mentioned, the document is actually stored on the iPad as opposed to 'the clouds'. Again, most of those mentioned are cut down versions of MS Word.
    Stand back and look at this constructively; do you need to regularly access to the document from more than one computer/device without the need to keep amending your document on your computer and sending it to your iPad? If so, Documente to Go etc may be the best choice.

Maybe you are looking for

  • Why is my color dialog blank?

    I was able to follow the whole tutorial in one evening (not without some difficulty). Everything in the design environment (IDE) looked the same in the video (or close enough) with exception of the pick-color dialog. My dialog was completely blank (n

  • Oracle Error in a Data Dictionary

    Is there a data dictionary or table that contains all Oracle errors and it's description?

  • How to startx on remote machine's monitor

    Hi there, I would like to startx on a remote machine, having the X session on that remote machine's display/monitor. Background: My machines all run Arch linux, and they all dont use a graphical login manager (like GDM or KDM or such). I usually log

  • GnuTLS error

    Hi, do you know how to fix this problem? Status:    Waiting to retry... Status:    Connecting to xxxx Status:    Connection established, waiting for welcome message... Response:    220 Welcome in the MATRIX. Command:    AUTH TLS Response:    234 Proc

  • Why does adobe flash player want to download on every website I try to go to?

    After signingin to my website, and trying to go to another thru a visual tag, I get a message from adobe to doenload the flash player. Isn't once enough?? Can't the programmers send a tag to see if it has already downloaded the flash player?? I'm jus