AppBar Icon |
AppBarIcon shares the same principle with AppBarButton, you can use IconKey to specify an Icon and IsCircleVisible to indicate if a circle is around the icon.
This Icon element can be embedded into another WPF Controls such as Button.
The following example shows how use AppBarIcon into a Button
<Button x:Name="btnSendRequest" Click="btnSendRequest_Click" Style="{DynamicResource FlatButtonStyle}"> <StackPanel Orientation="Horizontal"> <ui:AppBarIcon IconKey="appbar_arrow_right" Height="24" Width="24" IsCircleVisible="True" /> <TextBlock Text="Send Request" Margin="{DynamicResource Thickness4444}" /> </StackPanel> </Button>
The button shown in the user interface by the above XAML code will be:
With AppBarIcon, you have the possibility to control the size with Height and Width property.
The AppBarIcon applies the Foreground color of current context, in order to keep the harmony with another element. You can not change the color by yourself.
Following is an example used on ToggleButton, without circle around.
To archive this, you can use the following XAML code as example. This time it has no circle with Height and Width = 16 points.
<ToggleButton HorizontalAlignment="Center" x:Name="btnSettings" Style="{DynamicResource ToolbarToggleButtonStyle}" ToolTip="Options" > <StackPanel Orientation="Horizontal"> <ui:AppBarIcon IconKey="appbar_settings" Height="16" Width="16" /> <TextBlock Text="Options" Margin="{DynamicResource Thickness4444}" /> </StackPanel> </ToggleButton>