Windows 8: Creating Great App Bar Buttons

With chrome pushed out of Windows 8 Store applications, most of the navigation has been moved into the AppBar.  A good AppBar has buttons that are easy to reach and easy to recognize.

You can create your own images for the app bar, but it is rarely necessary. Instead, you can take advantage of the 150+ variations of AppBarButtonStyle in the StandardStyles.xaml file.  These are commented out by default, so just uncomment the ones you want, and they are as easy to use as,

<Button x:Name="DeleteEvent"

        Style="{StaticResource DeleteAppBarButtonStyle}"

        Click="DeleteEvent_Click_1" />

 

This places the button and its text right into your appbar.  Of course, there are times that you need an icon that is not available in the StandardStyles.xaml.  Before you create your own, however, open the Character Map application that comes with Windows 8, and set the drop down to Segoe UI Symbol,

CharacterMap

Notice that when you select one of the images, the hex code (E1D6) is displayed.  We can use that to place the image into our appbar,

<Button x:Name=”Record”
        Style=”{StaticResource AppBarButtonStyle}”
        AutomationProperties.Name=”Record”
        Click=”Record_Click”>&#xE1D6;</Button>

Here we’ve placed the hex value of the symbol we want between the open and close tags.  We’ve also placed the caption for the button in the AutomationProperties.Name field, which is used by the styles to create the text value for the TextBlock below the icon.

AppBarAs you can see, the images are placed in a circle,  the text is placed below and you end up with a very professional looking AppBar. 

About Jesse Liberty

Jesse Liberty has three decades of experience writing and delivering software projects and is the author of 2 dozen books and a couple dozen online courses. His latest book, Building APIs with .NET will be released early in 2025. Liberty is a Senior SW Engineer for CNH and he was a Senior Technical Evangelist for Microsoft, a Distinguished Software Engineer for AT&T, a VP for Information Services for Citibank and a Software Architect for PBS. He is a Microsoft MVP.
This entry was posted in Mini-Tutorial, Windows 8 and tagged . Bookmark the permalink.

3 Responses to Windows 8: Creating Great App Bar Buttons

Comments are closed.