Table of Contents

Welcome to Windows Phone 7 from the Trenches!

  1. Introduction to Windows Phone 7
  2. Getting Started
  3. Hello World! (coming soon)
    1. First Impressions Count
  4. Keeping the User Happy
    1. Creating Copyable Read-Only Text
    2. User-Friendly Input Pages
  5. Working with Maps and the Location Services
    1. APP: Car Finder. A reference application for mapping and the Location Services API.
    2. Showing the current location and an accuracy circle.
    3. Looking up an address based on your location using the WP7Contrib library.
    4. Changing the map source between the different Bing maps and to alternative sources such as OpenStreetMap and OpenCycleMap.
    5. Implementing analytics using Flurry.
  6. Working with the Device Sensors
    1. APP: Random Numbers. A reference application for using the accelerometer.
    2. Using the Shake Gesture Library to detect device motion.
    3. Implementing analytics using mtiks.
  7. Enjoying Some Fruity Mango Goodness
    1. Don’t Forget– A helper class for the Reminders API.

Getting Started

App HubApplications for Windows Phone 7 are managed applications that you create by using a version of Silverlight that is based on Silverlight 3 with a few device-specific APIs (which we’ll talk about in much more depth later). You can also create games by using the XNA Framework.

The only way to develop applications for Windows Phone 7 is by using the Windows Phone Developer Tools, which you can download from the App Hub[1]. The Windows Phone Developer Tools include the following tools and frameworks:

  • Windows Phone Developer ToolsVisual Studio 2010 Express.
  • Windows Phone Emulator.
  • Silverlight.
  • XNA Game Studio 4.0.
  • Microsoft Expression Blend for Windows Phone.
  • .NET Framework 4.

So, the Windows Phone Developer Tools includes everything that you need to design, build, and run applications and games for Windows Phone 7 without even owning a Windows Phone 7 device, and it’s all free.

[1] The App Hub is the official portal for application and independent game developers for Windows Phone 7 and Xbox. In order to distribute your applications through the Windows Phone or Xbox Live Marketplace you will need to sign up for membership and register for a developer account (at a cost of $99), but we’ll talk about that more later.


Installation is in three simple steps, but make sure you do them in this order:

  1. Download and install the Windows Phone Developer Tools. This contains the tools and frameworks described above.
  2. Download and install the Windows Phone Developer Tools January 2011 Update. This includes updates for the Bing Maps for Windows Phone Silverlight control, the Windows Phone Connect Tool, and the Windows Phone Capability Detection Tool.
  3. Download and install the Windows Phone Developer Tools Fix. This contains a fix that enables you to deploy XAP files over 64MB in size to physical devices for testing and debugging.

Other Frameworks and Libraries

Whilst the Windows Phone Developer Tools provides everything you need to develop applications for Windows Phone 7 (and it’s free), as with most Microsoft technologies these tools provide the basic building blocks with the flexibility for you to enhance and extend that framework. To this end, here’s a list of the additional frameworks and libraries that I use the most:

  • Silverlight for Windows Phone Toolkit. The February 2011 release is the latest at the time of writing. This is a reduced feature set from the Silverlight 4 Toolkit but includes some great controls such as the Toggle Switch, List Picker, and Long List Selector.
  • Coding4Fun Toolkitpatterns & practices: Prism. The v4 release (the latest at the time of writing) includes assemblies for Windows Phone 7 and brings commanding and event aggregation to Windows Phone 7 as well as a useful behaviour for text box binding. It does not include the Unity dependency injection container, though.
  • Coding4Fun Tools. This is another great library with controls such as About/Input Prompt, Progress Overlay and Time Span Picker, useful value value converters, and another binding helper for text boxes.

I’ll be talking about these libraries and giving detailed usage examples later on. Whilst Prism gives you pretty much everything you need to implement applications that implement the Model-View-ViewModel (MVVM) design pattern, many people are using the MVVM Light Toolkit by Laurent Bugnion; the Event-to-Command implementation is super useful.

Introduction to Windows Phone 7

Windows PhoneWindows Phone 7 is the new smartphone operating system from Microsoft. Instead of continuing the development of the Windows Mobile series (currently at 6.5), which has struggled to compete with both the iPhone and Android devices, Microsoft decided to “reboot” their smartphone operating system taking a fresh new look.


In a break from previous smartphone efforts Microsoft decided to have complete control over the hardware specification allowing manufacturers and carriers to modify only the applications and hubs that are provided on device. They also get closer access to the hardware enabling applications such as LG’s Look n Type messaging application that shows the live camera feed and ScanSearch that provides augmented reality search facilities with the camera.

The minimum hardware specific for Windows Phone 7 devices is:

  • Windows Phone 7 HardwareWVGA 480×800 or HVGA 320×480 screen[1].
  • Capacitive touch screen with at least 4 contact points.
  • GPU acceleration with DirectX 9 support and video acceleration.
  • ARMv7 Cortext/Scorpion or better CPU.
  • At least 256MB RAM, 8GB Flash or more.
  • A-GPS and accelerometer sensors.
  • 5 mega pixel camera or better, with LED flash and dedicated shutter button.
  • Dedicated hardware buttons for Back, Start, and Search.

The WP7 Device Hub at lists all the confirmed and rumoured Windows Phone 7 devices with specifications.

[1] At launch (and at the time of writing) only WVGA devices are available.

The Metro Design Language

The Windows Phone design team took inspiration from sources included Swiss-influenced print and packaging, transportation signage, and the Zune client software to create a design language called Metro to be used as the guiding principles for designing and developing Windows Phone 7 applications.

Metro Design Language

Metro Design Principles

  • Typography: Use the right balance of font weight and positioning to create a visual hierarchy and help lead the eye to more content.
  • Motion: Use consistent motion and animation to bring the interface to life.
  • Content not Chrome: Remove all chrome to bring content to the forefront.
  • Honesty: Design explicitly for the form factor taking into account the high resolution screen and touch-based interaction.

If you want to learn more about the Metro design language, you should check out the Metro Design Language for Windows Phone 7 tutorial on the Microsoft design .toolbox and From Transportation to Pixels by the Windows Phone Design Team.