At the start of the project, I read through the UI design guide for the windows phone. It is a really important first step towards understanding the design intentions of the people who were closest to making the phone.
One thing captured my eye – the idea that we didn’t have to be constrained by the bounds of the phone – by using the Panorama my application could be a long stretched out ribbon. I was giddy with excitement over all the screen real estate!
My next step was to grab my trusty notebook and sketch out all the screens I would have. Obviously there would be the scramble board, a list of words, a statistics screen, and a games screen to save/load.
Once I had figured out the general shape of my application I started building it – creating a separate user control for each page. Things were going well until I ran into a series of problems with the panorama control…
Problem 1: Using interactive controls on a panorama
My first challenge came quickly. Much like the problem described in this article with a map control, the game board screen allows you to drag and drop pieces to the bottom drop area. I could pick up a tile (no problem), but the moment I started moving it, the Panorama overrode my drag handling and started animating to the next page.
I had a massive conflict in gestures that I needed to solve. It took me several days to work out, but I realized that essentially the solution was – while a piece is in motion during a drag, that activity trumps any other gesture you might be doing to the phone. Using the ManipulationStarted event on a child of the Panorama, I would call e.Complete() while the drag was in progress. Once the drop was completed, I unsubscribed from the ManipulationStarted event. This allowed my drag to trump the flick of the panorama.
Problem 2: Where do the buttons go?
I struggled for a while with where to put a “new game” button. I experimented with the application bar so that I could have icons… but an applications bar and a panorama just don’t go well together. Between the panorama and the applications bar, I nearly ran out of all usable space to make the rest of the app.
Frustrated, I left it for a while as a series of buttons (which looked terrible) on the games page. At the end of the day I came up with a compromise – I liked the look of the application bar icons, which were handily available on the hard disk at “C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Icons”.
With this small fragment of XAML I had the look I wanted:
<Border MouseLeftButtonDown="CreateNew_Click" Width="60" Background="Transparent" Margin="0,20,20,0">
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="48"/>
<RowDefinition Height="auto"/>
</Grid.RowDefinitions>
<Image Width="48"
Source="/MyAppName;component/Images/appbar.basecircle.rest.png"/>
<Image Width="48"
Source="/MyAppName;component/Images/appbar.new.rest.png"/>
<TextBlock Text="new game" TextAlignment="Center"
TextWrapping="Wrap" Grid.Row="1"/>
</Grid>
</Border>
Problem 3: Setting the current page
Getting the “new game” button to elegantly show the scramble screen.
My new games button was on the last “Games” page and I wanted to have immediate feedback that it actually created a new game board. The best way I thought to do that was to navigate back to the “Scramble” page after the new game button had done its magic. I was totally confused because there was a SelectedItem property on the PanoramaControl, but it was read-only – I couldn’t change it. After digging around, I finally found the “DefaultItem” property, which successfully changed the current page.
I was disappointed to learn that if you want to skip pages in a panorama programmatically, there is no API that will allow you to animate to that page. In my case, the “games” page was adjacent to the “scramble” page – so while it does jump directly, at least it’s not disorienting.
Problem 4: Orientation within the application
In this instance I am not talking about holding the phone vertically versus horizontally – I’m talking about giving the user an idea where they are inside your application. You want to avoid questions like
“How do I get back to … I was just…?”
I handed an early prototype of the game to a friend, got the game started and stood back and watched, not saying anything unless she was really stuck. I just had a stock black background behind at the time. She accidentally flicked to another page “losing” the scramble screen and she let out a little scream - OMG what did I do? For a usability test - I had a clear sign I really needed to fix this.
When you look at the panorama control – only a little bit of the next page is visible (just a few characters from the next screen). For most casual observers, these few pixels of the next screen are not enough to tell you what’s coming next.
Also they have no idea that the world isn’t flat – e.g. if you keep flicking you’ll get back to page 1. So you have to adjust for the idea that people will circularly flick through the panorama – they won’t naturally.
Solution: Use a background
With a stock background matching the theme – my test users were too scared to explore – they don’t know if they have accidentally quit the application or not. From this I realized I needed a background that would indicate that the app continued off the edge of the screen. I needed to break with the metro theme (a little) so they most decisively knew they were still in my app.
It’s a bit of a long story, but at the same time I decided to pick a lettuce theme for the app. So I went down to the local supermarket, picked out several heads of butter lettuce and iceberg, grabbed my camera and had a photo shoot in the back yard.
The lettuce in this picture was subsequently eaten for lunch.
I added words to the background to not only give the idea that the application continued on in the left and right directions – but to give folks a bit of a hint to get started thinking of words. These words were the words that were in 30 or more puzzles.
After settling on the background – I needed to fix up my application so that the text would all be the correct color. In order to do this, rather than setting the foreground brushes on everything, I overrode the system styles in my app.xaml file. This meant I could configure everything in one spot. I was very pleased how well this worked!
<Application.Resources>
<SolidColorBrush x:Key="PhoneForegroundBrush" Color="White"/>
<SolidColorBrush x:Key="PhoneTextBoxReadOnlyBrush" Color="#7E7D7D"/>
<SolidColorBrush x:Key="PhoneTextBoxForegroundBrush" Color="#7E7D7D"/>
<SolidColorBrush x:Key="PhoneTextBoxEditBackgroundBrush" Color="#FFC4C3C3"/>
<SolidColorBrush x:Key="PhoneTextBoxBrush" Color="#FFC4C3C3"/>
<SolidColorBrush x:Key="PhoneBackgroundBrush" Color="Black"/>
</Application.Resources>
In order to test this, I left the phone simulator in the light theme (go into settings to change this), because black text would be the most obvious bug against this color background.
Conclusions
Panorama is a great control for applications where people want to explore – e.g. facebook / social media applications. It is not as good for applications where you want to have a a lot of interactivity.
If you have one page that is more interesting than the others, the others will tend to get neglected by the users.
If you use a panorama, backgrounds really do help solve a lot of the confusion – though it is best to go with simple backgrounds to not distract from the rest of the UI.
If you want to see it in action, the trial of nine lettuce is free!


