Create a simple navigation application in Windiows Phone 7 ( WP7 )

[highlight]Create a simple navigation application in Windiows Phone 7 ( WP7 ) [highlight]

In a Windows Phone application it is highly probable that you will have more than one screen in your application and you will need to navigate between them. We can make use of the navigation framework for the same. This navigation will be very similar to navigating from one web page to another. This navigation framework also supports query string.

So without much talk let’s go ahead and create a simple business information application of financial company ACME and learn navigation in WP7.

  • Goto visual studio 2010 and create new Windows Phone Silverlight and XNA Applicationand name it NavigationExample.

    Create Application

    Create Application

  • Add new folder to the NavigationExample named Views and inside Views add a new folder Locations.

    Add Folder

    Add Folder

  •  Now add Windows Phone Portrait Page named About and Contact in the Views folder

  • Similarly add Windows Phone Portrait Page named Corporate Office and Satellite office in the Locations folder.

    Windows Phone Portrait Page

    Windows Phone Portrait Page

  • Now lets open the pages and edit the default text on the pages.
  • Open MainPage.xaml and edit the text to as shown in the image below. Also drag and drop four HypelinkButton onto the MainPage.xaml

    MainScreen.xaml

    MainScreen.xaml

  • Now edit the HyperlinkButtons to point to the proper pages to be navigated. Use the image below to do the same.MainPage.xaml

    MainPage.xaml

    MainPage.xaml

  • Now open about.xaml, contact.xaml, corporateoffice.xaml, satelliteoffice.xaml and edit the headings.
  • Now run the application and you will see the screen as below. You can also navigate to different screens.
Navigation Example

Navigation Example

You can download the full source code here

Please remember to leave your feedback or appreciations or questions. Thanks

 

7 comments

  1. There is noticeably a bundle to know about this. I assume you made certain nice factors in options also.

  2. Woah! I’m really loving the template/theme of this website. It’s simple, yet effective. A lot of times it’s very hard to get that “perfect balance” between usability and appearance. I must say you have done a fantastic job with this. In addition, the blog loads super quick for me on Safari. Outstanding Blog!

  3. I must voice my gratitude for your kindness for people who really want guidance on this important content. Your special dedication to getting the solution around had been amazingly important and have continually permitted people like me to realize their aims. Your entire helpful instruction signifies a whole lot to me and even more to my colleagues. Warm regards; from everyone of us.

Leave a Reply

Your email address will not be published. Required fields are marked *