This lab introduces you to the Windows Phone layout system and the Chrome operating system/browser, including the basics of navigating between different screens (pages) in a Windows Phone Silverlight application. During the lab you will build a navigation application that switches between various screens, with each screen displaying different phone functionality, such as playing an audio or video file. You will also add an Application Bar to the main navigation page in order to expose some functionality within the application. In the process, you will learn how to use Visual Studio 2010 Express for Windows Phone in order to build and design a Windows Phone application. The lab assumes prior knowledge of XAML and familiarity with Silverlight 3 on the desktop.
The Windows Phone Application Platform enables:
- Awesome applications and games. Use Silverlight and XNA frameworks to craft interactive, compelling, high-quality applications and games for the Windows Phone 7.
- Fast, high quality and feature-rich applications. The combination of Visual Studio 2010 and Expression Blend with standardized Windows Phone 7 hardware specifications means more time is available for you to make your vision real on every device.
- Bigger opportunities. Better partnerships. Build exciting applications and games with your current skills and tools for Windows Phone 7, and reach customers no matter what device they use. Windows Phone Marketplace takes care of sales and distribution so you don’t have to. Code and collect!
Objectives
At the end of the lab you will:
- Have a high level understanding of the overall Silverlight application navigation model, specifically the page and frame navigation model within a Windows Phone 7 application
- PhoneApplicationFrame
- PhoneApplicationPage
- Using navigation services
- Handling the back button
- Know how to control phone orientation
- Know how to add an application bar and system tray into your application’s pages
- Know about the available controls for Windows Phone applications, including:
- ListBox
- WebBrowser
- Hyperlink buttons
- Media
Prerequisites
The following is required to complete this hands-on lab:
- Visual Studio 2010 Express for Windows Phone or Microsoft Visual Studio 2010
- Windows Phone Developer Tools
Note:All of these Tools can be downloaded together in a single package from http://developer.windowsphone.com
Setup
For convenience, much of the code used in this hands-on lab is available as Visual Studio code snippets. To install the code snippets:
- Run the .vsi installer located in the lab's Source\Setup folder.
Note:If you have issues running the code snippets installer you can install the code snippets manually by copying all the .snippet files located in the Source\Setup\CodeSnippets folder of the lab to the following folder: \My Documents\Visual Studio 2010\Code Snippets\Visual C#\My Code Snippets
Using the Code Snippets
With code snippets, you have all the code you need at your fingertips. The lab document will tell you exactly when you can use them. For example,

Figure 1 Using Visual Studio code snippets to insert code into your project
To add this code snippet in Visual Studio:
- Place the cursor where you would like to insert the code.
- Start typing the snippet name (without spaces or hyphens).
- Watch as IntelliSense displays matching snippets' names.
- Select the correct snippet (or keep typing until the entire snippet's name is selected).
- Press the Tab key twice to insert the snippet at the cursor location.

Figure 2 Start typing the snippet name

Figure 3 Press Tab to select the highlighted snippet

Figure 4 Press Tab again and the snippet will expand
To insert a code snippet using the mouse rather than the keyboard:
- Right-click where you want to insert the code snippet.
- Select Insert Snippet followed by My Code Snippets.
- Pick the relevant snippet from the list, by clicking on it.
To learn more about Visual Studio IntelliSense Code Snippets, including how to create your own, see http://msdn.microsoft.com/en-us/library/ms165392.aspx.
Exercises
This hands-on lab comprises the following exercises:
- Introduction to the Windows Phone Navigation Model
- Introduction to the Controls Available for Windows Phone applications
- Introduction to Windows Phone Services
Estimated time to complete this lab: 60 minutes.