Home > Uncategorized > Content Validation 5.5.2 WP7

Content Validation 5.5.2 WP7

One of the most common reason for rejection for Windows Phone 7 (Wp7) apps, is support for dark and light themes.  Most developers work in the dark theme, then not realizing that the text can’t be read when the phone is switched to light theme. This is picked up by Microsoft Testers, and reported as a Content Violation 5.5.2

Requirements
Application content, such as text and visual
elements, must be visible and legible regardless of
the phone theme. For example, if the phone
theme changes from black background to white
background, the text and visual elements of your
application must be visible or legible.

Comments: STEPS TO REPRODUCE
1. Navigate to the Settings page in the app list.
2. Tap theme and change Background to ‘Light’.
3. Launch your application.
4. Verify that the text and visual elements of the application are visible and legible.
RESULT
The application UI text is not legible when viewed in the ‘Light’ theme.

 

Here, is a solution I have come up with for “Panorama” style apps, by creating two backgrounds, one mostly black, one mostly white, and then calling the following function on MainPage_Loaded

/// <summary>
/// Detect theme, and apply background accordingly
/// </summary>
private void DisplayState()
{
Color lightThemeBackground = Color.FromArgb(255, 255, 255, 255);
SolidColorBrush backgroundBrush =
Application.Current.Resources[“PhoneBackgroundBrush”] as SolidColorBrush;
// Assume dark theme
BitmapImage bitmapImage = new BitmapImage(new Uri(“PanoramaBackground.png”, UriKind.Relative));
if (backgroundBrush.Color == lightThemeBackground)
{
// you are in the light theme
bitmapImage = new BitmapImage(new Uri(“LightPanoramaBackground.png”, UriKind.Relative));
}
ImageBrush imageBrush = new ImageBrush();
imageBrush.ImageSource = bitmapImage;
this.panorama.Background = imageBrush;
}

 

Advertisements
Categories: Uncategorized
  1. No comments yet.
  1. No trackbacks yet.

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

%d bloggers like this: