LP Pinsonneault blog's

Windows 8, Windows Phone, ...

NAVIGATION - SEARCH

Circular navigation on Windows Phone 7 : How to fix it?

When we develop an application for Windows Phone 7. One of the problem that a developer will face at the most is the circular navigation. On the phone, the navigation service handle the stack used by the back button. So each time we call the method Navigate of the NavigationService, a new entry is stored in the stack. On the other side there are some rules that a developer must follow to pass the certification on the Marketplace:
- circular navigation is not allowed
- the back button on the home page must exit the application.

There is some times that the scenarios doesn’t fit the rules for the Marketplace. So we end up more often with a circular navigation. Also which doesn’t help, it’s that we don’t have access to modify the navigation stack. This issue probably occurred very often in the certification process. First because, the developer did look at the Requirement documentation before creating his application. And second, because there is some times that the limitation doesn’t give us much choice.

(Image taken from the Windows Phone team blog)

 

So Microsoft listen and provide us with a solution. I’m glad because i had to use it in one of our application recently. The solution is pretty simple, we have to add a class in our application. Instantiate that class in the App class (App.xaml.cs). After what, we continue to handle the navigation as usual, but if we forgot to handle the back navigation or we face a scenario where we cannot handle the back navigation properly, we just have to navigate to the desired page (ex: navigate to the home page). At that time, if the class identify a circular navigation it will automatically handle the back navigation for us until we end up to the specified page.

But don’t be to lazy, and don’t rely on that mechanism. You should be aware of the Marketplace requirement first and follow them. But if in a specific case you don’t have a choice then you have a solution.

Get the code:
http://create.msdn.com/en-us/education/catalog/article/nln-serv-wp7

Get more information about the non-linear navigation:
http://windowsteamblog.com/windows_phone/...silverlight-applications.aspx

I hope this will help you.

Regards,
LP

Comments (3) -

Perfect! very good writer.I had to say that this blogs is really amazing. Very interesting article. I learned a lot thanks!

Reply

Hi, was just browsing through the internet looking for some information and came across your blog. I am impressed by the information that you have on this blog. It shows how well you understand this subject. Bookmarked this page, will come back for more. You, my friend, ROCK!!

Reply

I am just collecting stuffs related to Windows Phone Development so this tutorial is very beneficial for me in the nearest future.So, I really like your post. It is very beneficial and interesting.

Reply

Add comment

biuquote
  • Comment
  • Preview
Loading