Created
February 6, 2014 16:39
-
-
Save martinsuchan/8847868 to your computer and use it in GitHub Desktop.
AppBarButton exceptions in Windows 8.1
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<Page x:Class="BlankApp1.MainPage" | |
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation" | |
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"> | |
<Page.Resources> | |
<!-- this works --> | |
<Style x:Key="Style1" TargetType="AppBarButton"> | |
<Setter Property="Icon" Value="Previous" /> | |
</Style> | |
<!-- these throw exception --> | |
<Style x:Key="Style2" TargetType="AppBarButton"> | |
<Setter Property="Icon"> | |
<Setter.Value> | |
<SymbolIcon Symbol="Previous" /> | |
</Setter.Value> | |
</Setter> | |
</Style> | |
<Style x:Key="Style3" TargetType="AppBarButton"> | |
<Setter Property="Icon"> | |
<Setter.Value> | |
<FontIcon Glyph="💿"/> | |
</Setter.Value> | |
</Setter> | |
</Style> | |
</Page.Resources> | |
<Page.BottomAppBar> | |
<CommandBar x:Name="Bar" IsOpen="True"> | |
<CommandBar.PrimaryCommands> | |
<AppBarButton Style="{StaticResource Style1}" Label="Style1"/> | |
<AppBarButton Style="{StaticResource Style2}" Label="Style2"/> | |
<AppBarButton Style="{StaticResource Style3}" Label="Style3"/> | |
</CommandBar.PrimaryCommands> | |
<CommandBar.SecondaryCommands> | |
<AppBarButton Icon="Previous" Label="NoStyle1"/> | |
<AppBarButton Label="NoStyle2"> | |
<AppBarButton.Icon> | |
<SymbolIcon Symbol="Previous" /> | |
</AppBarButton.Icon> | |
</AppBarButton> | |
<AppBarButton Label="NoStyle3"> | |
<AppBarButton.Icon> | |
<FontIcon Glyph="💿" /> | |
</AppBarButton.Icon> | |
</AppBarButton> | |
</CommandBar.SecondaryCommands> | |
</CommandBar> | |
</Page.BottomAppBar> | |
</Page> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment