Fixing display glitch in WP7 test projects

The Silverlight Unit Testing Framework for Windows Phone 7 is an integral part of my workflow. One thing that has bugged me every time I use it, though, is how I always saw some clipped-off graphics on the bottom of the test harness screen. It looked like some useful information–what was it?

What are those clipped elements at the bottom of the screen?

Turns out there is a simple fix. Although it isn’t noticeable, the WP7 system tray (where the clock and signal icons go) is enabled. The tray pushes the rest of the page elements down.

To disable it, open the MainPage.xaml file in your test project and set the shell:SystemTray.IsVisible="True" flag to False:


x:Class="MyApp.Tests.MainPage"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:phone="clr-namespace:Microsoft.Phone.Controls;assembly=Microsoft.Phone"
xmlns:shell="clr-namespace:Microsoft.Phone.Shell;assembly=Microsoft.Phone"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
mc:Ignorable="d" d:DesignWidth="480" d:DesignHeight="768"
SupportedOrientations="Portrait"
Orientation="Portrait"
shell:SystemTray.IsVisible="False">

Now when you run the tests, you’ll see a bar across the bottom of the screen that summarizes the results of your test run.

The graphic turns out to be a summary of the test run. Cool!

Advertisements

Leave a comment

Filed under Windows Phone 7

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s