Windows Phone 7 System Styles

When you add a new page to your WP7 application project, the default XAML page is likely to contain references to style definitions such as PhoneTextNormalStyle and PhoneTextTitle1Style.

<!--TitlePanel contains the name of the application and page title-->
<StackPanel x:Name="TitlePanel" Grid.Row="0" Margin="12,17,0,28">
    <TextBlock x:Name="ApplicationTitle" Text="MY APPLICATION" Style="{StaticResource PhoneTextNormalStyle}"/>
    <TextBlock x:Name="PageTitle" Text="page name" Margin="9,-7,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>

Those two style definitions are applied to the application title and page title of the page with the goal that all WP7 applications will share similar look.

Application Title and Page Title in WP7 Application

Just as you would use .NET libraries (as opposed to crafting your own wheels), you should use the built-in styles available. To discover more style definition that you can use, browse the file ThemeResources.xaml found in C:\Program Files (x86)\Microsoft SDKs\Windows Phone\v7.0\Design. Using these styles will guarantee that the application’s look will still be presentable when users change the color theme.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.