My diary of software development

StandardStyles.xaml Visualizer

Overview

When I started working with WinRT apps in Visual Studio,one of the first things I noticed was all the AppBar Button styles in the StandardStyles.xaml dictionary. There are almost 200 in there although they are all commented out by default when you create a new project.

Deciding which button to put on my AppBar was a common thing I found myself doing and it was also frustrating since I couldn’t immediately see what these buttons looked like. There were places online which described how to examine the Segoe UI font in the Windows Character Map dialog but that was a big pain and it didn’t really show me what those AppBar Buttons would look like.

Capture

What I needed was some type of visualizer for the styles in the StandardStyles.xaml file.

my resource viewer application

There are 4 main types of styles in StandardStyles.xaml:

  1. AppBarButtons
  2. Buttons
  3. TextBlocks
  4. RichTextBlocks

I needed an application that would read StandardStyles.xaml, collect the above 4 types of styles, and display each style’s target control on the screen. And it would be nice if I could click the styled control and get the XAML for creating a control with that style copied to my clipboard.

I wanted to be able to click this:

click

And get this on my clipboard:

<Button
Style="{StaticResource ZeroBarsAppBarButtonStyle}"
AutomationProperties.Name="ZeroBarsAppBarButtonStyle"
/>

I’ve pasted screenshots of this app to provide a visual reference here for the 4 types of styles in StandardStyles.xaml. If you’re interested in the source code of my app, I’ve uploaded it to my SkyDrive here.

app_bar_buttons reference

This section shows all 192 AppBarButton styles.

1

2

3

4

5

6

7

8

9

10

11

12

13

14

15

16

17

18

19

20

21

22

button reference

This section shows the 6 Button styles.

23

text_block reference

This section shows the 13 TextBlock styles.

24

25

26

27

rich_text_block reference

This section shows the 4 styles.

28

29

Advertisements

Comments on: "StandardStyles.xaml Visualizer" (3)

  1. […] this all works, and why it’s there…”Tools, Services, Frameworks, & LibrariesStandardStyles.xaml Visualizer (Christopher Pope)“When I started working with WinRT apps in Visual Studio, one of the first […]

  2. Awesome! Thanks for sharing!

  3. Christopher Schoob said:

    Very usefull thanks a lot !

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: