Windows Phone 8 SDK and Applying Styles in Visual Studio 2012

We generally use the Built-in styles for the Windows Phone controls so that the App is theme aware and looks good in both the dark and the light theme with different accent colors.

For example , the textbox can have the following style

<TextBlock x:Name=”txt1″ Style=”{StaticResource PhoneTextNormalStyle}” />

In the previous version of the Visual Studio , when developing the Windows Phone app , the developer had to type in the complete name of the style or another simple thing was to switch to Blend to add the style.

Windows Phone 8 SDK and Applying Styles in Visual Studio 2012

The Visual Studio 2012 brings in a cool feature that lets you easily apply the styles in the designer .

To add a built in style to an element in Visual Studio , follow the below steps

1. Select the element in the designer and Right click to display the context menu .

2. Click “Edit Style” -> “Apply Resource” and then select the predefined styles from the list as shown in the below screenshot.

3. This will add the selected style attribute to the element.

Leave A Reply

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

You May Also Like

In this post, you’ll learn about the Win32 Error “0x000019E5 – ERROR_COULD_NOT_RESIZE_LOG” that you get when debugging system erors in...
In this post, you’ll learn about the error “CO_E_DBERROR 0x8004E02B” that is returned when working with COM based APIs or...
In this post, you’ll learn about the Win32 Error “0x000019D0 – ERROR_LOG_BLOCK_VERSION” that you get when debugging system erors in...