Windows Phone Design For Developers

Advertisement

There is a prevalent belief amongst developers that design is a skill that can’t be learned — you either have it or you don’t. While much of this can be attributed to the perception that heightened creativity is required to produce good design, the truth is anyone can create attractive applications and good user experience by following common design patterns and applying guidelines for the particular platform being targeted.

So rejoice, Mr. “Not-a-Designer,” this article was written just for you. This article is targeted at the everyday developer looking for practical guidelines and tips to leverage in their Windows Phone application to build compelling Windows Phone UI-compliant apps with solid user experiences. Think of it as a checklist of sorts to ensure that your app avoids the common design problems found in Windows Phone applications.

Please see the User Experience Design Guidelines for Windows Phone1 for a complete overview of the platform and user interaction model on Windows Phone.

Panorama Controls

The aptly named Panorama is one of the innovative controls of the Windows Phone platform. Whereas a traditional mobile application is designed to fit within the boundaries of the screen, the Panorama control allows for a long horizontal canvas, to lay out elements that extend beyond the confines of the screen. The Panorama control is composed of a number of Panorama items, which contain the content. When viewing each Panorama item, the user will see a little piece of the item to the right, indicating that additional content is waiting to be discovered. As the user pans horizontally across the Panorama, the control exhibits a parallax behavior — smoothly moving the background, title and items at different speeds.

When creating your panorama, approach it as if you were designing a magazine cover — it should engage the user and entice them to explore more. It should reveal relevant, fresh and compelling content, and it should serve as the entry point to the rest of the application. Panoramas are great for showing a few pieces of content that you want to highlight in your app — the top news from your social network, the last eight songs played, the top six featured recipes. Consider also adding a background image to your Panorama control to provide a more visually appealing and immersive experience.

Given the popularity of the control, you can find inspiration for designing your Panorama in many apps on Windows Phone. Several of the native apps, or “hubs,” on Windows Phone also use the Panorama control, such as those for People, Pictures, Games and Office.

People Hub2
The native People “hub” Panorama without a background image on Windows Phone.

Pictures Hub3
The native Pictures “hub” Panorama with a background image on Windows Phone.

Optimized for Up to Five Items

While fitting a lot of content into your main Panorama might be tempting, really think through what content will provide the best launch experience, and limit the number of items to five or fewer. Any more than five items will cause users to get lost in the Panorama control and will also result in a performance hit.

Don’t Compete With Swipe Gestures

The following controls would compete with swipe gestures in a Panorama:

  • Toggle switches,
  • Sliders,
  • Maps,
  • Web browsers.

The Panorama control provides horizontal scrolling to navigate the various items and vertical scrolling for each item. Using a control that accepts gestures for one of these actions in a Panorama would cause it to compete with the native functionality. For example, if a user wants to explore a Panorama control and swipes left in a Map control, then they will pan across the map, rather than move the panorama. For this reason, use only controls that don’t accept swipe gestures. There is one proviso — you could use a Map or Web Browser control in a Panorama as long as it is locked and doesn’t accept touch input.

Scrollable Items

The items on your Panorama control should scroll either horizontally or vertically, but not both.

Incorrect Panorama4
Incorrect layout of Panorama, with items that scroll both horizontally and vertically.

Correct Panorama5
Correctly designed Panorama, with items that distinctly scroll either horizontally or vertically.

Eliminate (or Limit) Interactive Content

The Panorama control is intended to be digested like a magazine cover — it’s a tool to reveal key content for the user and to serve as an entry point to explore the app. The Panorama should not be the application itself, so limit the use of interactive controls in it (forms, search boxes), and put them instead on pages within the app that are designed for those purposes.

Use the Application Bar for Actions

Avoid floating buttons (i.e. buttons placed within content) where possible. Ideally, all buttons should be placed in the Application Bar and should be changed or hidden contextually as the user swipes across the items.

Alignment And Layout

Left-Align Controls, With a 24-Pixel Margin

All pages should respect the 24-pixel margin on the left, which serves as a perimeter for content. Content should be left-aligned to the 24-pixel margin to continue the balance and flow of existing controls. Elements that creep outside or inside the margin create visual imbalance, drawing attention to the inconsistent margin.

Incorrect Alignment6
Improper alignment of elements from top to bottom.

Correct Alignment7
Correct left-alignment of elements

Tip: Check out Jeff Wilcox’s MetroGridHelper8 for a great little tool to help ensure that your controls are properly aligned, while also debugging your application.

The MetroGridHelper places a semi-transparent grid of 25 × 25-pixel red squares on your application when running in debug mode. These squares are contained within a padding of 24 pixels around the page and are offset by 12 pixels between one another — the magic combo for Windows Phone design. The grid enables you to quickly and easily identify any alignment issues on the page.

MetroGridHelper9

Adding MetroGridHelper to your app is very straightforward:

  1. Use the NuGet package manager to install the MetroGridHelper package, and add a reference in your project.
  2. Open the App.xaml.cs file, and add MetroGridHelper.IsVisible = true; to the constructor within the block of code that checks whether the debugger is attached. Your complete constructor should look like this:
 /// Constructor for the Application object. ///
        public App()
        {
            // Global handler for uncaught exceptions. 
            UnhandledException += Application_UnhandledException;
            // Standard Silverlight initialization 
            InitializeComponent();
            // Phone-specific initialization 
            InitializePhoneApplication();
            // Show graphics profiling information while debugging. 
            if (System.Diagnostics.Debugger.IsAttached)
            { 
                // Display the current frame rate counters. 
                Application.Current.Host.Settings.EnableFrameRateCounter = true;
                // Show the MetroGridHelper 
                MetroGridHelper.IsVisible = true;
                PhoneApplicationService.Current.UserIdleDetectionMode = IdleDetectionMode.Disabled;
            }
        }

Lay Out Field/Value Pairs Cleanly

When creating a page with a set of field and value pairs, the textblock elements should be presented either in two columns, both aligned left, or with the titles above the fields.

Incorrect Name Pair10
Incorrect layout makes it difficult to discern where the label ends and the value begins.

Good Name Pair11
A two-column layout produces an interface that is cleaner and easier to read.

Best Name Pair12
Placing the label above the field is the best approach because it creates visual hierarchy and clearly distinguishes between field/value pairs.

Space Elements by a Multiple or Subdivision of 12 Pixels

Spacing between elements should be consistent both horizontally and vertically. A multiple or subdivision of 12 pixels is recommended in order to adhere to the design grid.

Incorrect Spacing13
Inconsistent horizontal and vertical spacing.

14
Consistent spacing creates a cleaner layout.

Animation And Visual Feedback

Tip: The Silverlight for Windows Phone Toolkit15 lets you easily add tilt animations, page transitions and a performance progress bar to your application.

Visual Feedback via Tilt Animations

Buttons, list items and other controls being used as buttons should have a tilt effect to provide visual feedback to the user. Changes in color should not be used for visual feedback.

Visual feedback has the following benefits:

  1. It helps to distinguish between interactive and static elements,
  2. It allows the application to communicate back to the user and confirm the user’s actions.

Correct Visual Feedback16
Using color changes to provide visual feedback would be inconsistent with native apps.

Incorrect Visual Feedback17
Tilt animation provides visual feedback and makes the user experience consistent.

Implementing the tilt effect requires only a couple of lines of code in your XAML page:

  1. Add a reference to Microsoft.Phone.Controls.Toolkit.dll in your project. This DLL is installed with the Silverlight for Windows Phone Toolkit.
  2. Add a namespace to the XAML that references the DLL:
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit".
  3. Set the IsTiltEnabled property of TiltEffect to true in the PhoneApplicationPage tag:
    toolkit:TiltEffect.IsTiltEnabled="True".

That’s it. The final XAML of your PhoneApplicationPage tag should look something like this:

XAML Tilt18

Use Page Transitions to Add Polish

Page transition animations can add attractive effects to an application and communicate to the user that they are navigating between pages.

Turns Tile 119
Turnstile page transition.

Turns Tile 220

Turns Tile 321

Turns Tile 422
Turnstile page transition.

Six page transitions are included in the Silverlight for Windows Phone Toolkit:

  • Turnstile,
  • Swivel,
  • Slide,
  • Roll,
  • Rotate.

Adding page transition animations is similar to adding the tilt effect:

  1. Add a reference to Microsoft.Phone.Controls.Toolkit.dll in your project. This DLL is installed as part of the Silverlight for Windows Phone Toolkit installation.
  2. Add a namespace to the XAML that references the DLL:
    xmlns:toolkit="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone.Controls.Toolkit".
  3. Paste the XAML code below into your page:

        
            
                
            
            
                
            
        
    
    
        
            
                
            
            
                
            
        
    

Use a Bar to Indicate Progress

Just as you use tilt animation to indicate to the user that their tap has taken effect, progress bars enable you to communicate that a process is being executed. This removes doubt for the user about whether the application is functioning properly. Two types of progress bars can be used: determinate and indeterminate.
Determinate Progress Bar23
Determinate progress bar.

Indeterminate Progress Bar24
Indeterminate progress bar.

A determinate progress bar is used to communicate the percentage of completion, such as the percentage of bytes copied out of the total number of bytes. An indeterminate progress bar is much more common and is particularly useful when you don’t know the length of the process, such as when calling a Web service and waiting for a response.

Buttons

Place Buttons in the Application Bar

Collapsed Application Bar25
Collapsed application bar.

Expanded Application Bar26
Expanded application bar.

Avoid floating buttons (i.e. buttons placed within content) where possible. Such buttons usually make the experience inconsistent and confusing. The Application Bar serves as a fixed home for buttons on the page, a design paradigm that is consistent with native apps. Another big benefit is that the Application Bar is always visible, even when the software keyboard is shown. This eliminates the common problem of buttons being hidden behind the keyboard, and it allows for instant access to the buttons. Floating buttons might make sense in a few places, though:

  • “Settings” pages, where more verbose actions are needed,
  • Quick action buttons associated with list entries, such as a “Play” button next to a song item or a “Call” button next to a contact item in a list.

Avoid “Back” and “Close” Buttons

Every Windows Phone has a physical “Back” button. Windows Phone users are used to using the hard “Back” button to navigate back in an application or to end (or cancel) an action, thus eliminating the need for a soft “Back” button. The result is a more consistent experience and less clutter.

Avoid “Home” Buttons

“Home” buttons break the Windows Phone’s navigation model and are strongly discouraged. Users know to use the hard “Back” button to navigate back to the home screen. A “Home” button might make sense in a few scenarios, though:

  • Applications with a very deep navigation hierarchy,
  • Pages that launch via a deep-linking “secondary tile.”

If you do end up using a “Home” button in your application, make sure that you completely clear out the back stack upon navigating to the home page. This is critical because without clearing the back stack, the user could get stuck in a near infinite loop and would be unable to exit the application via the hard “Back” button. To clear your back stack, override the OnNavigatedTo method on the page that you are navigating to, and add in the code shown here:

protected override void OnNavigatedTo(System.Windows.Navigation.NavigationEventArgs e)
{
    while (NavigationService.CanGoBack)
    {
        NavigationService.RemoveBackEntry();
    }
    base.OnNavigatedTo(e);
}

The above code is a simple loop which checks to see if the application can go back and removes the most recent item off the back stack. Once it can no longer go back, your back stack has been cleared.

Summary

One of the most important factors in delivering the best experience on any mobile platform is to design the app for the platform and its accompanying usage patterns.

The Windows Phone UI represents a fresh approach to the phone experience. The first step in building a compelling Windows Phone UI-compliant application is to spend time using the apps that ship with the OS. This will familiarize you with Windows Phone’s unique set of controls and design paradigms.

A lot of beautifully designed third-party apps can be found in the Windows Phone Marketplace, so plenty of inspiration is available. Some of my favorites have innovated on the Windows Phone design principles to deliver a truly compelling experience, such as the Cocktail Flow27 app published by Gergely Orosz.

Once you have the basics down and have begun to piece together the visuals for your application, refer to the guidelines in this article. They will help you avoid some of the most common mistakes that I have seen when reviewing designs for my app partners.

(al)

Footnotes

  1. 1 http://msdn.microsoft.com/en-us/library/hh202915(v=vs.92).aspx
  2. 2 http://www.smashingmagazine.com/wp-content/uploads/2012/06/people-hub.jpg
  3. 3 http://www.smashingmagazine.com/wp-content/uploads/2012/06/pictures-hub.jpg
  4. 4 http://www.smashingmagazine.com/wp-content/uploads/2012/08/incorrect-panorama.png
  5. 5 http://www.smashingmagazine.com/wp-content/uploads/2012/08/correct-panorama.png
  6. 6 http://www.smashingmagazine.com/wp-content/uploads/2012/06/incorrect-alignment.png
  7. 7 http://www.smashingmagazine.com/wp-content/uploads/2012/06/correct-alignment.png
  8. 8 http://www.jeff.wilcox.name/2011/10/metrogridhelper/
  9. 9 http://www.smashingmagazine.com/wp-content/uploads/2012/06/metrogridhelper.png
  10. 10 http://www.smashingmagazine.com/wp-content/uploads/2012/06/incorrectnamepair.png
  11. 11 http://www.smashingmagazine.com/wp-content/uploads/2012/06/goodnamepair.png
  12. 12 http://www.smashingmagazine.com/wp-content/uploads/2012/06/bestnamepair.png
  13. 13 http://www.smashingmagazine.com/wp-content/uploads/2012/06/incorrectspacing.png
  14. 14 http://www.smashingmagazine.com/wp-content/uploads/2012/06/correctspacing.png
  15. 15 http://silverlight.codeplex.com
  16. 16 http://www.smashingmagazine.com/wp-content/uploads/2012/06/correctvisualfeedback.png
  17. 17 http://www.smashingmagazine.com/wp-content/uploads/2012/06/incorrectvisualfeedback.png
  18. 18 http://www.smashingmagazine.com/wp-content/uploads/2012/06/xaml-tilt.png
  19. 19 http://www.smashingmagazine.com/wp-content/uploads/2012/06/turnstile1.png
  20. 20 http://www.smashingmagazine.com/wp-content/uploads/2012/06/turnstile2.png
  21. 21 http://www.smashingmagazine.com/wp-content/uploads/2012/06/turnstile3.png
  22. 22 http://www.smashingmagazine.com/wp-content/uploads/2012/06/turnstile4.png
  23. 23 http://www.smashingmagazine.com/wp-content/uploads/2012/06/determinate.png
  24. 24 http://www.smashingmagazine.com/wp-content/uploads/2012/06/indeterminate.png
  25. 25 http://www.smashingmagazine.com/wp-content/uploads/2012/06/collapsedappbar.png
  26. 26 http://www.smashingmagazine.com/wp-content/uploads/2012/06/expandedappbar.png
  27. 27 http://cocktailflow.com/

↑ Back to topShare on Twitter

Reza Alizadeh is the Chief Technology Evangelist for Windows Phone with Microsoft’s Developer & Platform Evangelism team. His main focus is working with top mobile app partners in the Western US and supporting their efforts to adopt the Windows Phone platform, while also supporting the general development community. Reza has been involved in the mobile space for over four years, having created a successful mobile app startup prior to joining Microsoft, which published over twenty applications and accumulated 8M+ downloads on iOS and other platforms. Reza holds a degree in Computer Science and an MBA from the University of Southern California.

Advertising
  1. 00

    No comments have been posted yet. Please feel free to comment first!
    Note: Make sure your comment is related to the topic of the article above. Let's start a personal and meaningful conversation!

Leave a Comment

Yay! You've decided to leave a comment. That's fantastic! Please keep in mind that comments are moderated and rel="nofollow" is in use. So, please do not use a spammy keyword or a domain as your name, or else it will be deleted. Let's have a personal and meaningful conversation instead. Thanks for dropping by!

↑ Back to top