Skip to content

Commit 86db63d

Browse files
committed
illustrate how to badge a toolbar button [skip ci]
1 parent e9200ba commit 86db63d

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

MainDemo.Wpf/MenusAndToolBars.xaml

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@
5151
</MenuItem>
5252
</Menu>
5353
<ToolBarTray DockPanel.Dock="Top">
54-
<ToolBar Style="{DynamicResource MaterialDesignToolBar}">
54+
<ToolBar Style="{DynamicResource MaterialDesignToolBar}" ClipToBounds="False">
5555
<Button ToolTip="Follow me on Twitter" Click="TwitterButton_OnClick">
5656
<materialDesign:PackIcon Kind="TwitterBox" />
5757
</Button>
@@ -69,6 +69,13 @@
6969
<Button Command="Paste" ToolTip="Paste some stuff" ToolBar.OverflowMode="AsNeeded">
7070
<materialDesign:PackIcon Kind="ContentPaste" />
7171
</Button>
72+
<!-- when badging in a toolbar, make sure the parent ToolBar.ClipToBounds="False", and
73+
manually apply the button style -->
74+
<materialDesign:Badged ToolBar.OverflowMode="AsNeeded" Badge="{materialDesign:PackIcon Alert}">
75+
<Button ToolTip="Badge it up!" Style="{StaticResource {x:Static ToolBar.ButtonStyleKey}}">
76+
<materialDesign:PackIcon Kind="AirplaneTakeoff" />
77+
</Button>
78+
</materialDesign:Badged>
7279
<Separator/>
7380
<ListBox>
7481
<ListBoxItem ToolTip="This is a lonley toggle with TextBlock instead of icon">

0 commit comments

Comments
 (0)