locked
How can I only allow 1 copy of an app page to exist at a time? RRS feed

  • Question

  • My app can open webpages in a page containing a webviewer. If the user manages to tap more than one item (very quickly - tapping the 2nd item before the page has navigated away) it seems to be opening multiple instances of my webviewing page (I can hear video in the background as if there is another page that I can't actually see, for example). And if the user messes around too much the app becomes unresponsive (presumably because it's doing too many things at once).

    The testers seem to have started actively trying to make apps crash in this way.

    I navigate to my pages like this:

    Me.Frame.Navigate(GetType(NewsArticlePage), newsfromtweet)

    I want a way to check that a page of NewsArticlePage hasn't already been created or a way to only move to the existing page and open the tapped link in that page. How can I do this?


    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

    Tuesday, August 13, 2013 12:43 AM

Answers

  • A simple approach here:

    Before navigating to the "NewsArticlePage",  just set IsHitTestVisible property of the listing control(ListView or GridView in which items are listed) to false. So that the next click will not happen. Also don't forget to set the same property to True on the OnNavigatedTo event of the page where listing is done.


    - Ram
    If a post answers your question, please click "Mark As Answer" on that post and "Mark as Helpful".

    • Edited by Ramprasath R Tuesday, August 13, 2013 12:10 PM
    • Marked as answer by Anne Jing Sunday, August 18, 2013 1:57 PM
    Tuesday, August 13, 2013 10:25 AM