Nick's .NET Travels

Continually looking for the yellow brick road so I can catch me a wizard....

Enabling Windows Phone 7 Themes in Emulator Applications

I just noticed that Peter has put up a post on how to make a Windows Phone 7 application theme aware. I couldn’t help but recall one of the more obscure side comments in one of the MIX sessions where the presenter commented out a bunch of code in the App.xaml file in order to get theming to work correctly.  Anyhow, if you’re interested the section of xaml to comment out is the following:

        <!-- Brush Resources -->
        <!--<SolidColorBrush x:Key="PhoneAccentBrush" Color="{StaticResource PhoneAccentColor}"/>
        <SolidColorBrush x:Key="PhoneBackgroundBrush" Color="{StaticResource PhoneBackgroundColor}"/>
        <SolidColorBrush x:Key="PhoneContrastForegroundBrush" Color="{StaticResource PhoneContrastForegroundColor}"/>
        <SolidColorBrush x:Key="PhoneForegroundBrush" Color="{StaticResource PhoneForegroundColor}"/>
        <SolidColorBrush x:Key="PhoneInactiveBrush" Color="{StaticResource PhoneInactiveColor}"/>
        <SolidColorBrush x:Key="PhoneDisabledBrush" Color="{StaticResource PhoneDisabledColor}"/>
        <SolidColorBrush x:Key="PhoneSubtleBrush" Color="{StaticResource PhoneSubtleColor}"/>
        <SolidColorBrush x:Key="PhoneContrastBackgroundBrush" Color="{StaticResource PhoneContrastBackgroundColor}"/>
        <SolidColorBrush x:Key="PhoneTextBoxBrush" Color="{StaticResource PhoneTextBoxColor}"/>
        <SolidColorBrush x:Key="PhoneBorderBrush" Color="{StaticResource PhoneBorderColor}"/>
        <SolidColorBrush x:Key="PhoneTextSelectionBrush" Color="{StaticResource PhoneTextSelectionColor}"/>
        <SolidColorBrush x:Key="TransparentBrush" Color="Transparent"/>—>

You should be aware that this effectively breaks the current design experience within Visual Studio and can even cause the IDE to crash.  I actually closed all my open documents before making this change and then un-commented the xaml once I was done testing the theme support.

Anyhow, here’s a (poorly designer) test application that shows the Light theme option:


  • pakistan web hosting

    12/11/2010 5:09:25 AM |

    We are also very happy to now offer pakistan hosting services, regardless of whether or not you want us to build you a website;
    There's no need to go scouring the net for a great hosting service to compliment your new site…
    GFsoul does hosting and takes care of all the important details.
    Our design, development and hosting services perfectly compliment each other; we are offering customers true "one-stop shopping" experience, and at extremely affordable prices for design, development and hosting for pakistan and worldwide. You won't find customized design and hosting at these amazingly low prices anywhere buy here.
    Our hosting services features all of the same appointments that other (better known) hosting services can offer you, but with lots of great tech support, customization and a lower overall cost.

Comments are closed