Skip to content

RequestTheme cannot take effect on caption button #10766

@BigHeadDev

Description

@BigHeadDev

Describe the bug

I plan to implement a black and white theme switching function.
For other elements, it works normally, but for the caption buttons in the upper right corner have a confusing response to theme switching

Steps to reproduce the bug

1.Use the TitleBar control provided by WAS 1.7 as the title bar
2.MainWindow.xaml

<Grid
    x:Name="root"
    d:DataContext="{d:DesignInstance Type=vm:MainViewModel}"
    Loaded="root_Loaded">
    <Grid.RowDefinitions>
        <RowDefinition Height="Auto" />
        <RowDefinition />
    </Grid.RowDefinitions>

    <TitleBar x:Name="titleBar"/>
    <OtherElement Grid.Row="1"/>
</Grid>

3.MainWindow.xaml.cs

public MainWindow() {
    this.InitializeComponent();
    ExtendsContentIntoTitleBar = true;
    AppWindow.TitleBar.ExtendsContentIntoTitleBar = true;
    AppWindow.TitleBar.PreferredHeightOption = TitleBarHeightOption.Tall;
    AppWindow.SetIcon("favicon.ico");
    AppWindow.Title = titleBar.Title = AppInfo.Current.DisplayInfo.DisplayName;
    SetTitleBar(titleBar);
}

4.Change root's RequestTheme

  • My Windows Theme:Light
  • root's RequestTheme:Dark

but My application 👇👇👇

【Active】

- It is difficult for the eyes to detect caption buttons
Image

【Not Active】
Image

Expected behavior

Fixed the color display confusion of caption buttons in the form activation state after switching RequestTheme

Screenshots

No response

NuGet package version

Windows App SDK 1.7.3: 1.7.250606001

Packaging type

Packaged (MSIX)

Windows version

Windows 11 version 23H2 (22631, June 2025 Update)

IDE

Visual Studio 2022

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    needs-triageIssue needs to be triaged by the area owners

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions