Skip to content

Commit ca0c932

Browse files
KebooCopilot
andcommitted
Add demo toolbar with custom background to showcase overflow button fix
Adds a second toolbar example in both MainDemo and MaterialDesign3.Demo that uses a custom background with overflow items forced via OverflowMode=Always, demonstrating that the overflow button now inherits the toolbar's background color. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
1 parent 5baa036 commit ca0c932

File tree

2 files changed

+34
-0
lines changed

2 files changed

+34
-0
lines changed

src/MainDemo.Wpf/MenusAndToolBars.xaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -378,6 +378,22 @@
378378
</ToolBarTray>
379379
</smtx:XamlDisplay>
380380

381+
<smtx:XamlDisplay Margin="0,16,0,16" UniqueKey="menus_toolbar_custom_bg">
382+
<ToolBarTray>
383+
<ToolBar Background="{DynamicResource MaterialDesign.Brush.Primary.Dark}"
384+
ClipToBounds="False"
385+
Style="{StaticResource MaterialDesignToolBar}">
386+
<Button Content="{materialDesign:PackIcon Kind=ContentSave}" ToolTip="Save" />
387+
<Button Content="{materialDesign:PackIcon Kind=ContentCut}" ToolTip="Cut" />
388+
<Button Content="{materialDesign:PackIcon Kind=ContentCopy}" ToolTip="Copy" />
389+
<Button Content="{materialDesign:PackIcon Kind=ContentPaste}" ToolTip="Paste" />
390+
<Button Content="{materialDesign:PackIcon Kind=FormatBold}" ToolBar.OverflowMode="Always" />
391+
<Button Content="{materialDesign:PackIcon Kind=FormatItalic}" ToolBar.OverflowMode="Always" />
392+
<Button Content="{materialDesign:PackIcon Kind=FormatUnderline}" ToolBar.OverflowMode="Always" />
393+
</ToolBar>
394+
</ToolBarTray>
395+
</smtx:XamlDisplay>
396+
381397
<Rectangle Style="{StaticResource PageSectionSeparator}" />
382398
<TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Context Menus" />
383399

src/MaterialDesign3.Demo.Wpf/MenusAndToolBars.xaml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -346,6 +346,24 @@
346346
</ToolBarTray>
347347
</smtx:XamlDisplay>
348348

349+
<smtx:XamlDisplay Margin="5,16,0,16"
350+
DockPanel.Dock="Top"
351+
UniqueKey="menus_toolbar_custom_bg">
352+
<ToolBarTray>
353+
<ToolBar Background="{DynamicResource MaterialDesign.Brush.Primary.Dark}"
354+
ClipToBounds="False"
355+
Style="{StaticResource MaterialDesignToolBar}">
356+
<Button Content="{materialDesign:PackIcon Kind=ContentSave}" ToolTip="Save" />
357+
<Button Content="{materialDesign:PackIcon Kind=ContentCut}" ToolTip="Cut" />
358+
<Button Content="{materialDesign:PackIcon Kind=ContentCopy}" ToolTip="Copy" />
359+
<Button Content="{materialDesign:PackIcon Kind=ContentPaste}" ToolTip="Paste" />
360+
<Button Content="{materialDesign:PackIcon Kind=FormatBold}" ToolBar.OverflowMode="Always" />
361+
<Button Content="{materialDesign:PackIcon Kind=FormatItalic}" ToolBar.OverflowMode="Always" />
362+
<Button Content="{materialDesign:PackIcon Kind=FormatUnderline}" ToolBar.OverflowMode="Always" />
363+
</ToolBar>
364+
</ToolBarTray>
365+
</smtx:XamlDisplay>
366+
349367
<Rectangle Style="{StaticResource PageSectionSeparator}" />
350368
<TextBlock Style="{StaticResource PageSectionTitleTextBlock}" Text="Context Menus" />
351369

0 commit comments

Comments
 (0)