Please note that as of October 24, 2014, the Nokia Developer Wiki will no longer be accepting user contributions, including new entries, edits and comments, as we begin transitioning to our new home, in the Windows Phone Development Wiki. We plan to move over the majority of the existing entries over the next few weeks. Thanks for all your past and future contributions.
Solving Circular Navigation in Silverlight for Window Phone
This article explains how to resolve circular navigation problem that may occurs in the navigation between pages in Silverlight for Windows Phone.
Windows Phone 7.5
In the Silverlight for Windows Phone application model which is using several pages as its element, almost all applications consist of the various pages and the user has the right to navigate back. For each application, Windows Phone also keeps back-stack of pages which is a history of the pages that have been visited by the user. With such mechanism, developers are often faced with a situation where the application has a loop on page navigation.
Loop on the back-stack from the application navigation means there is duplication of the same page in the application back-stack. For example, the illustration can be seen in game Petualangan Aksara di Tanah Jawa below:
Another example, when you create registration wizard, it requires a lot of inputs so it consists of several pages. If we use NavigationServices.Navigate() method to return to the MainPage then we will return to the GamePage when we press the 'Back' button. In fact, the expected response is out of the application.
The solution to overcome this problem is to use a NonLinear Navigation Services library developed by Windows Phone Recipes.
The steps which must be done are quite easy, as follow:
- Download File:NonLinear-WP-SLApp-Navigation-Service.zip
- Add NonLinearNavigationServices project in the Solution which has been created.
- Initialize the service at the end of class constructor whose class is the inheritance of Application class.
With NonLinear Navigation Services, developer will be easier to develop applications because they do not need to waste a lot of time thinking about the navigation management of the application.
Kiriaty, Yochay. 2010. Solving Circular Navigation in Windows Phone Silverlight Applications.