Windows Phone 7 Development Tip: Discovering and Using Default Styles

August 10 2010

I was playing around with the Windows Phone 7 tools and noticed that there are some system styles available for text.  For example, I noticed the following XAML that referenced PhoneTextTitle1Style in one of the Visual Studio project templates:

            <TextBlock x:Name="ListTitle" Text="{Binding LineOne}" Margin="-3,-8,0,0" Style="{StaticResource PhoneTextTitle1Style}"/>

I then wanted to figure out what all the system styles were.  How to do it? Expression Blend!  By going to the Assets tab and then clicking Styles --> System Styles, I was able to see all the styles:

 

I then wanted to see what they looked like, so I double clicked each one, which created a textbox. To correlate the look with the name, I replaced the default text with the name of the style, producing this:

 

Perhaps this graphic/tip will help someone out there!

Comments (3) -

8/7/2010 5:40:38 AM #

Kevin Hazzard

Great tip. Thanks! These can also be found in the Windows Phone 7 SDK at: C:\Program Files\Microsoft SDKs\Windows Phone\v7.0\Design\ThemeResources.xaml.

Kevin Hazzard

8/21/2010 7:02:06 AM #

Matt Lacey

Thanks for doing this. I've been using it as a reference for the last few days.

Saved me a bunch of time.
Thanks.

Matt.

Matt Lacey

11/17/2010 9:02:54 PM #

andreas hammar

Nice!

You can also in blend right-click on eg a textbox, choose 'edit style' then 'apply resource'. That will give you a preview of the available styles.

/A

andreas hammar

Pingbacks and trackbacks (7)+

Add comment

biuquote
  • Comment
  • Preview
Loading

VSAchievements
Visual Studio Achievements
Karsten Januszewski (207 Points)