Failing Marketplace Submission – A Dose of my own Medicine

I’d been helping someone out with a Windows Phone 7 application. Like many other apps, the app retrieved data from a webservice. If there was an issue retrieving data, a message would be displayed to the user which, in XAML looked like a bit like this:

<Border x:Name="NoDataMessage" 
  <Border VerticalAlignment="Center">
      <TextBlock TextAlignment="Center"
        Text="Service unavailable. Please check your network." 
        Style="{StaticResource PhoneTextLargeStyle}" />

Or a bit like this if your XAML visualisation capabilities are a bit rusty:


Simple but effective. You simply toggle the message visibility (or databind it) depending on the results of the web request.

There’s a classic problem here though – and one that caused the app to fail certification. Section 5.5 of the Application Certification Requirements document states

2011-05-03 10h44_29

I even talk about this when I present on tips & tricks for passing Marketplace certification as it’s a very common failure. If I switch the device to the light theme, this is what the message looks like


Not so clever. The Textblock inherits the PhoneForegroundBrush colour which inverts to black when the user selects the light theme. Unfortunately that means we’re now presenting black text on a black background (with a 75% opacity applied, making it appear grey). It’s invisible and causes the app to fail a basic certification requirement.

A simple fix is to set the Foreground property of the Textblock to White (as the Background is always black this works). You could do something more sophisticated using PhoneBackgroundBrush / PhoneContrastBackgroundBrush / PhoneForegroundBrush / PhoneContrastForegroundBrush I’m sure.

The moral of the story is – check all of your pages, under all conditions, under both light and dark themes. Otherwise don’t be surprised when someone on the Marketplace testing team does.

FYI - A full list of theme resources is available on MSDN.

Comments (1)

  1. Saintchubs says:

    I did exactly the same thing last week. Spent ages testing it in Dark theme but forgot to check Light theme. Wasted 3 days on such a simple check. Although, I will never forget to check again.

Skip to main content