Skip to content

Commit 881fb72

Browse files
Tweaks to TabbedCommandBar to make it work better with WinUI 2.6
We should investigate further better updates to the template in a redesign for the new design guidelines.
1 parent f66d31c commit 881fb72

File tree

1 file changed

+18
-4
lines changed

1 file changed

+18
-4
lines changed

Microsoft.Toolkit.Uwp.UI.Controls.Core/TabbedCommandBar/TabbedCommandBarItem.xaml

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,22 @@
22
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
33
xmlns:controls="using:Microsoft.Toolkit.Uwp.UI.Controls"
44
xmlns:muxc="using:Microsoft.UI.Xaml.Controls">
5+
<ResourceDictionary.ThemeDictionaries>
6+
<ResourceDictionary x:Key="Dark">
7+
<!-- TODO: This still seems a bit dark? -->
8+
<SolidColorBrush x:Key="ContextualTabBackground"
9+
Color="{ThemeResource SystemAltMediumHighColor}" />
10+
</ResourceDictionary>
11+
<ResourceDictionary x:Key="Light">
12+
<SolidColorBrush x:Key="ContextualTabBackground"
13+
Color="{ThemeResource SystemChromeMediumColor}" />
14+
</ResourceDictionary>
15+
<ResourceDictionary x:Key="HighContrast">
16+
<SolidColorBrush x:Key="ContextualTabBackground"
17+
Color="{ThemeResource SystemAltLowColor}" />
18+
</ResourceDictionary>
19+
</ResourceDictionary.ThemeDictionaries>
520

6-
<SolidColorBrush x:Key="ContextualTabBackground"
7-
Color="{ThemeResource SystemAltMediumColor}" />
821
<SolidColorBrush x:Key="NormalTabBackground"
922
Color="{ThemeResource SystemChromeLowColor}" />
1023
<SolidColorBrush x:Key="NormalTabAcrylicBackground"
@@ -25,7 +38,8 @@
2538
(See this message in the WinUI channel: https://discord.com/channels/372137812037730304/671870147354427422/771057634203402300 )
2639
Hardcoding the height of the CommandBar works, but it's a bit of a hack.
2740
-->
28-
<Setter Property="Height" Value="40" />
41+
<!-- TODO: Increased this for now, but if we want more compact, we have to identify the padding/margin that changed between WinUI 2.5 and 2.6 -->
42+
<Setter Property="Height" Value="48" />
2943
<Setter Property="HorizontalContentAlignment" Value="Stretch" />
3044
</Style>
3145

@@ -40,7 +54,7 @@
4054
Visibility="{Binding Visibility}" />
4155
</DataTemplate>
4256
<DataTemplate x:Key="ContextualTabTemplate">
43-
<muxc:NavigationViewItem Background="{StaticResource ContextualTabBackground}"
57+
<muxc:NavigationViewItem Background="{ThemeResource ContextualTabBackground}"
4458
Content="{Binding Header}"
4559
Visibility="{Binding Visibility}">
4660
<muxc:NavigationViewItem.Resources>

0 commit comments

Comments
 (0)