At the MVP Global Summit in 2010, Microsoft stunned the attending MVPs by announcing Windows Phone 7 (WP7). For two years, I sat in the Summit sessions listening to the giants of the Windows Mobile programming world tell Microsoft they needed to up the ante in the mobile wars. We had been hearing rumblings of Windows Mobile 7 for a while, but no details. Most of us thought it would be more of the same old thing. When Microsoft told the session attendees that there had been a change in focus and a change in direction, it was welcome news. As they informed us of their new vision, I was completely overwhelmed. This article is an attempt to convey what I heard. I anticipate you will be as excited as I am.

The Beginnings

In addition to revamping the management and programming teams and rewriting the operating system from the ground up, Microsoft spent a great deal of money and time in research to determine the target audience of the new platform. Their research led them to the concept of “Life Maximizers.” These are people who are juggling families and businesses or jobs. They are extremely busy and are looking for ways to manage their time and life in a more focused manner. Microsoft developed a phone system that reflects the speed of people’s lives in motion and provides a seamless experience in use.

Using this concept, Microsoft developed a user interface (Figure 1) that works in tandem to the busy lifestyle of their target audience to bring an integrated experience. To keep the UI free from clutter and non-essential information, Microsoft developed the “Metro” theme. This theme comes from the busy urban environment where white lettering on dark color backgrounds conveys information immediately to the seeker.

Figure 1: WP7 start screen.

In keeping with this theme, Metro uses a black background with white lettering. Metro concentrates on a clean, light, and fast interface using various fonts to enhance the visual experience. Animation in Metro is well thought and is an adjunct to the Metro experience rather than gratuitous programming candy. The entire focus of Metro is on content and making it readily available to the user. This combination is easy to read, easy on the eyes and aesthetically pleasing.


One of the lessons learned in the mobile wars is that standardization of hardware is essential to the success of any given mobile platform. Microsoft embraced this lesson, telling the hardware manufacturers that there is a minimum set of standards that must be met if they wish to use WP7 as their core operating system. These include as a minimum:

  • Screen resolution
  • 480 x 800 (initial release)
  • 340 x 620 (available in the future)
  • 4-point capacitive multi-touch
  • 1 GHz processor
  • 8GB flash memory (no SD card support)
  • 5MP camera
  • Sensors (accelerometer, GPS, compass, proximity, and light)
  • 3 hardware buttons (Back, Search, Home) + Camera button
  • FM radio receiver

By limiting the hardware to a specific set of standards, programmers can develop software to that specification, knowing that their software will run on all phones running WP7. This is a bold departure from the Windows Mobile 6.5 model where there were numerous form factors and hardware.

The following hardware manufacturers have announced their hardware for WP7: HTC Corp, Dell, LG, and Samsung. These manufacturers ensure that you will have a choice of options and features when you go to buy your new WP7.


In addition to the Metro theme and standardization of hardware requirements, Microsoft planners developed the concept of “hubs” - dynamically updated real-time centers - which serve to aggregate information into a central place where access is quick and timely. No longer is the user dependent on static icons to launch their experience. There are a number of hubs in the new design.

Real-time hubs aggregate all of the user’s information into a central space for quick access.

People Hub

This hub aggregates feeds from all of the user’s live feeds from social networks and photos into a single location. It will show you up-to-date information and allow you to post updates to Facebook and Windows Live.

Pictures Hub

This photo wallet application allows you to share pictures and videos with your favorite social networking site. You integrate both the web and the PC creating one spot for your entire picture and video collection.

Music + Video Hub

This hub gives you the full media experience of Zune, including all of your PC content, online music services and FM radio stations. Utilize Zune Social to share media with your friends.


You can discover new pre-certified apps and games and download them to your phone.


With the power of Office Mobile, which is included in the release, you can stay productive on the go. You have access to Office, OneNote, and SharePoint workspace in one spot. You can easily read, edit and share documents. Your calendars and email are now easier to manage with color coding to separate work from personal. At release, WP7 users will have access to cloud services which will sync documents to and from your PC.

Xbox LIVE Hub

The Xbox Live hub is your entry point from WP7 to your Xbox Live account. You can track and keep up to date on your points, avatars, unlocked achievements, etc. Because the mission of WP7 is to aggregate web information and make your life easier to manage, WP7 will update the Xbox Live tile to show your friend requests or other gaming actions available.

By including both the Zune hub and the Xbox LIVE hub in WP7, Microsoft made a calculated move to entice its existing user base of millions of Zune and Xbox users to move to WP7 for a continuation of their current experience. Electronic Arts is partnering with Microsoft for WP7 and has an entire line of games available for WP7.

WP7 also supports the concept of “live tiles.” A tile is a link to an application and provides real-time updates to content. For example, an email live tile may show the number of unread messages, the phone live tile will show missed calls or voice mails. This is an attempt to coordinate all of your information in one convenient spot. Figure 1 shows the Xbox LIVE and people hubs as well as a few blue live tiles.

Live tiles show real-time application information at a glance.

The Developer Story

When Microsoft announced their vision for the WP7 future, they included both Silverlight and XNA C# as the development platforms. Which one you choose for your development platform depends on numerous reasons. See the sidebar to help you determine which one to use. One of the major stumbling blocks in Window Mobile 6.5 was the lack of inexpensive tools to promote development. With WP7, Microsoft announced Visual Studio 2010 Express, a free edition of Visual Studio complete with all the necessary bits to create phone applications. It includes:

  • Expression Blend for WP7
  • WP7 developer tools
  • Silverlight 4 toolkit
  • XNA 4.0
  • Visual Studio Express

This decision opens up the programming market for WP7 to anyone with a computer and an Internet connection.

Taking it a step further, Microsoft announced that current students enrolled in school can request a subscription to Dream Spark and receive professional versions of the development tools.

The Windows Phone Marketplace

The Windows Phone Marketplace (WPM) is Microsoft’s response to the Apple App Store. A number of the policies are equivalent to the Apple store:

  • $99.00 fee to join the developer network (
  • 5 free apps (additional at $19.99)
  • Unlimited paid apps
  • The fee is waived for students via the Dreamspark program.
  • 70/30 revenue split on paid apps
  • Payable when $200.00 in revenue is accumulated.

Developing for WP7 is a comprehensive process and is outlined in Figure 2, which shows the application development lifecycle from start to finish.

Figure 2: Application Development Lifecycle - courtesy of Microsoft.

Any apps submitted to the WPM will be verified for content which must conform to the rules in the WP7 Application Certification Requirements document available at Figure 3 shows the application certification process.

Figure 3: Application Certification Process for Windows Marketplace.

The WPM also offers a number of options that are not available to Apple developers. These include a trial API and various business models to suit individual business requirements.

The trial API allows the developer to control the type and length of the trial with a few lines of code. Since the full version of the program is already included in the download from the marketplace, using the trial API allows your user to upgrade to the premium version with no further downloads. Once the transaction for the paid app is processed, the app is unlocked and fully operational.

Using the trial API is as simple as adding a reference to Microsoft.Phone.Marketplace to your application and then calling LicenseInformation.IsTrial(). It returns true if the app was installed in trial mode and allows you to modify the behavior as desired.

Business models include the free and paid apps mentioned above and ad-funded and “freemium” models.

The ad-funded model has a number of features unique to WP7. These are live tiles, pinning and toast. Ad-funded applications are downloaded to the phone from the Windows Phone Marketplace and the developer can create a live tile for the app which permits them to keep in touch with their customers, sending information, news of updates, promotional information and coupons, etc., which are displayed on the live tile for the user to see and interact with.

The user can also pin the application live tile to the Start screen giving it preference in the list of tiles so that they can see and keep informed. If neither of these two modes is in use, the third option to keep in touch with your users is to toast them. A toast is an instant message which pops up at the top of the phone and alerts the user to something new, in this case, a message from you.

A “freemium” application is one that is free on the marketplace but requires a paid service to utilize. Netflix is a great example. The app is free, but unless you have a subscription to the Netflix service, the app is useless.

One of the perceived drawbacks to the initial release of WP7 is the fact that the enterprise functionality of WM 6.5 is not available. Version 1 is targeting the individual “life maximizers” not the enterprise. The enterprise functionality will return to Windows phone in the future.

Installing Apps to Your Phone

The only way you can load an app to a phone outside the development environment is through the marketplace; however, at this time, there is no provision in the marketplace to limit availability of your application to a select list of potential users or to create a market within the marketplace. Post your app on the marketplace and the whole world has access to it.

You can use either XNA or Silverlight as the platform for application development. Currently, the only supported development languages are C# and Visual Basic. WP7 does not support Silverlight running in a browser; therefore, all Silverlight applications for WP7 run out of the browser.

I’ll develop the examples for this article in Silverlight and C#. This new version of WP7 also brings a new paradigm for development. No longer do developers, carriers or handset manufacturers have pInvoke access to the underlying operating system. All access is through a managed API.

MVVM (Model-View-ViewModel)

One of the default best practices for developing an app for the new phone is to use the MVVM design pattern. MVVM is not difficult to understand or implement and there is much information available via Bing to show how to use this pattern in your development. Essentially, it splits the app into at least three tiers:

  • The View is the page you design.
  • The Model is your data feed
  • The ViewModel is a POCO (plain old CLR objects) class inheriting from INotifyPropertyChanged. This class contains property definitions for each of your fields on the view and methods implementing necessary business logic.

The fields on the View are then bound directly in the XAML and are updated when the ViewModel informs the View that the property has changed. Multiple views can be bound to the same ViewModel.

Purists argue for no code in the code-behind file and that all communication between the View and the ViewModel be based on the principle of commanding and/or relay messaging. While this is the ultimate, many programmers use the code-behind routinely.

Besides the obvious benefit of separation of concerns and cleaner coding, this pattern provides easy unit testing of your code.

Unlocking Your Phone

To get started, either download Visual Studio 2010 Express or, if you already have a paid version of Visual Studio 2010 installed, download and install just the Windows Phone Developer Tools (download from

When you download and install the phone bits, there are two programs placed in the Windows Phone Developer Tools folder in your Start directory: the Windows Phone Developer Registration program and the application deployment tool.

Figure 4 shows the Windows phone developer registration UI. You must enter the Windows Live ID and password that you used to register with the developer network. Once you have done so, the phone is unlocked so that you can push your apps from Visual Studio 2010 to the phone. Registering as a developer allows you to unlock three phones for deployment. At any time, you can delete a phone and add a different one. Outside of the Marketplace, this is the only way to deploy apps to the phone.

Figure 4: Windows Phone Developer Registration.

The deployment app that comes with the installation allows you to install a xap file, after registering your phone, directly to your phone without going through Visual Studio 2010.

Beginning Your First Phone App

Launch Visual Studio and select New Project. Choose the Silverlight for Windows Phone templates. You want to choose the template that will be most useful for your application. In this case, choose the Windows Phone Application and provide a name your project (Figure 5).

Figure 5: Creating a new Windows Phone 7 project using Silverlight.

This template generates a project containing a number of files (Figure 6):

Figure 6: Generated files in the Solution Explorer.
  • App.xaml - This file and its corresponding code behind permits you to control application-wide settings and behaviors.
  • MainPage.xaml - This is the main page that displays when the app is loaded and running.
  • Application Images - Resources for the application and the default splash screen.

Double-click on the MainPage.xaml (Figure 7). In the XAML code, there is a StackPanel in the main LayoutRoot grid that sets application information about your project and applies a set Metro style to the data entered. Any XAML that you add to the page will go in the grid named ContentPanel in the middle of the XAML code list.

Figure 7: New Project Main Page.

The section of commented code at the bottom of the XAML section is code which controls the application bar and associated menu items.

In the XAML in the PhoneApplicationPage tag, there is an attribute named SupportedOrientations and one called Orientations. These options control the application page rendering as portrait or landscape. If you choose simply Portrait for the SupportedOrientations for your page, then twisting the phone from side to side will have no effect on the page display as it will always be portrait. You can choose between: PortaitAndLandscape, Landscape and Portrait.

To add new pages to your project, right-click on the project and choose Add, then New Item, and pick the appropriate page template from the list presented.

Navigating Between Pages

WP7 uses the Navigation service in System.Windows.Navigation to provide for navigating to pages in the application. Here is the syntax:

NavigationService.Navigate(new Uri("/name.xaml",

One of the new hardware requirements is the Back key on the lower left side of the phone. Pressing the Back key navigates to the previously selected page and exits the application if you press it from the application’s root page. You can override the OnBackKeyPress method to trap this button press and execute code. The Windows Phone 7 UI Design and Interaction Guide (available from contains the warning that “developers should only implement Back key behaviors that navigate back or dismiss context menus or modal dialog boxes. All other implementations are prohibited.”

Application Tombstoning

Your application cannot interfere with any of the standard behaviors of the phone. For instance, your application cannot disable incoming phone calls or turn off GPS, etc. Because WP7 does not support multi-tasking in the first release, your application can be deactivated anytime based on what either the user or phone wishes to accomplish. Pressing any of the hardware buttons or launching another application causes your application to be deactivated. When this happens, if the phone needs more available ram, it will close your application. This behavior is called tombstoning. Application tombstoning will destroy any session data or program state when the program is reactivated or closed.

In the final release bits, the development team added four events to the app.xaml.cs that you need to be aware of. These are: application_launching, application_activated, application_deactivated and application_closing. Place code in these events to handle each of the various states. Once your application is tombstoned, your application has 10 seconds to save application state so that it can be restored if the application is reactivated.

Since an embedded database won’t be available in the first release (although Microsoft SQL Server Compact is on the phone but not reachable), you will have to use isolated storage to save your data (Listing 1).

You should place your code to save data in application_deactivated or application_closing and you should place the code to load data in application_launching or application_activated depending on your requirements. The ability to save application state is also handy if your program requires a connection to a web-service. If your connection is down, you can save the data and retry when you have a valid connection.

Having learned from previous experiences with Windows Mobile versions, the Windows Phone team made the conscious decision to prevent direct access to the underlying operating system. This decision prevents developers from performing potentially dangerous operations, prevents carriers from tweaking phone behavior to disable capabilities, and standardizes both code and access security to phone hardware.

The Sensor API

The built-in sensors are:

  • Accelerometer
  • Assisted GPS
  • Camera
  • Compass
  • Proximity Sensor
  • Light Sensor

Of these sensors, developers can only use and interact with the accelerometer, assisted GPS (AGPS), and the camera. The compass API is not ready yet, and the last two are system sensors. The proximity sensor blackens the screen when held near to an object while in a phone call. The light sensor is used to dim the screen at night.

Listing 2 shows how to use the accelerometer. The AGPS is initialized similarly.

Launchers and Choosers

Launchers are fire and forget tasks. They will not return values to the application:

  • BingMaps
  • SearchTask
  • MarketPlaceLauncher
  • MediaPlayerLauncher
  • PhoneCallTask
  • SaveEmailAccessTask

The snippet shows you how to launch a SearchTask and Figure 8 shows the results of the search.

Figure 8: Completed Search task.
private void btnSearch_Click(object sender,
RoutedEventArgs e)
   SearchTask searchTask = new SearchTask();
   searchTask.SearchQuery = "nodenug";

Choosers are tasks which initiate a user interaction and expect something to be returned to the application. These include:

  • CameraCaptureTask
  • PhoneNumberChooserTask
  • PhotoChooserTask
  • EmailAddressChooserTask

Listing 3 shows how to initiate a CameraCaptureTask. The other choosers are used the same way, exchanging CameraCaptureTask for the names of the other chooser in the code listing.


There are three types of notifications that you as a developer can use. These are:

  • Tile notification - This lets you change the main application tile on the Start experience. You can display custom messages, counts of messages, actions available, etc. The tile notification alerts your user that there are actions available.
  • Toast notification - This lets you popup a message on the device which displays as an overlay onto the top of the user’s current screen even if your application is not running. There are a few best practices for using toast notifications:
  • Toast notifications should be personally relevant and time critical.
  • Toast notifications should primarily be focused on peer-to-peer communication.
  • Raw notification - This lets you send raw data to the running application which you can receive via an event. This pops up on your application like a MessageBox and has an OK button to close the dialog.

Each of these notifications depends on a cloud service available to developers. If you bind your notifications to tiles and toasts to this cloud service, you can provide a seamless, automatic update.

You can see a great set of tutorials for studying and using notifications at


As you can see, there is great power, flexibility and thoughtful design in WP7. Microsoft has engineered the developer story to encompass the totality of your experience from getting the free tools, writing your first app, posting it to the developer portal, seeing it on the marketplace, and walking your profits to the bank. Microsoft has also developed the infrastructure on the Internet to support those development efforts. The top links for you will be:

Microsoft listened to its developer community and made great free tools available to everyone who wishes to create advanced apps for the WP7 using Silverlight or XNA. You no longer have any excuse for not creating the next killer app.