Friday, August 31, 2012

Windows 8 AppBar style not found.

The Windows 8 AppBar comes with a set of default icons embedded in a set of AppBarButtonStyles.


These styles are available inside the StandardStyles xaml file inside the Common folder of your Windows 8 XAML project.

The strange this was that when I tried to apply these styles to my AppBar buttons, Visual Studio complained that it couldn’t find the related resource:

<Button Style="{StaticResource AddAppBarButtonStyle}" />

I spent way too much time before I discovered that for one reason or another the AppBarButtonStyles were commented out inside the StandardStyles.xaml. Doh!

After uncommenting the styles I wanted to use, it worked perfectly.

1 comment:

ranjan said...

For me even after commenting out, it doesn't show in assets. I have to include the styles manually into the xaml file. any idea?