Open
Description
Describe the bug
You cannot set the background color of a TitleBar by setting its Background property or setting AppWindow.TitleBar.BackgroundColor
Steps to reproduce the bug
- Create a Blank WinUI3 app
- Upgrade the WindowsAppSdk Nuget package to 1.6 experimental 2
- Change the project file to add
<WindowsSdkPackageVersion>10.0.19041.35-preview</WindowsSdkPackageVersion>
Add this code in MainWindow.xaml.cs
public MainWindow()
{
this.InitializeComponent();
ExtendsContentIntoTitleBar = true;
AppWindow.TitleBar.BackgroundColor = Colors.Red;
}
Add this code to MainWindow.xaml:
<Grid>
<Grid.RowDefinitions>
<RowDefinition Height="Auto" />
<RowDefinition Height="*" />
</Grid.RowDefinitions>
<TitleBar Title="Title" Subtitle="SubTitle" IsBackButtonVisible="True"
IsPaneToggleButtonVisible="True" Background="Red">
<TitleBar.IconSource>
<FontIconSource Glyph="" />
</TitleBar.IconSource>
</TitleBar>
<Grid Grid.Row="1" Background="Aqua">
</Grid>
</Grid>
Run the project. Although the TitleBar background is set in two places, the background is still transparent
The workaround to this to add a control below the title bar with the background
This project has a sample of the bug https://github.com/brunosonnino/TitleBarBugs/tree/main/3%20-%20TitleBarBackground
Expected behavior
The title bar should change colors
Screenshots
NuGet package version
WinUI 3 - Windows App SDK 1.6 Experimental 2: 1.6.240701003-experimental2
Windows version
Windows 11 (22H2): Build 22621
Additional context
No response