简体   繁体   中英

Last view superimposed on current view when double-back navigating

I do the following navigation pattern:

  1. Navigate into the app (and it's main view)
  2. Go into a detail view that fetches something from a REST server (that is - it shows a progress indicator for a few seconds)
  3. While progress indicator still is shown, I click the back-button twice in quick succession (easy to do by mistake)
  4. The app returns to the main view, but with the content of the detail view superimposed on it.

A screenshot of the resulting mess is shown below.

This was recreated both on a Nokia Lumia 800 and HTC Titan.

First of all - what the h..? And is there anything I could have done to make this happen?

There is no exceptions (or anything else) shown in the output. The only thing happening in the OnNavigatedFrom() method of the detail view is nulling out the background image (for memory reasons). It happens in other views as well.

My idea is that the draw method on both views are called on different threads, leaving only the main view to be responsive.

Any idea as to what has happened here, and how I can fix this bug?

发生了什么的截图

This type of issue happened to me when using TransitionFrame from Silverlight for Windows Phone toolkit. Using transitions when navigating from page to page can cause this if the user taps on back button once or twice while the transition/navigation is in progress.

I believe it's a bug, but couldn't find it reported at the official CodePlex site of the toolkit , therefore I don't know about any reliable solution or workaround except trying to handle the back button press on the page that's causing issues. In other words, catching the back button/key press and either disabling it (I'm not sure that this would pass certification!), or simply prompting user with a MessageBox that the page is still loading and if they are sure that they want to navigate back, might work for you. Other solution I can think of is that you avoid using TransitionFrame, but that's not really a solution, right? :)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM