Skip to content

WindowCaptionButtonThemeWorkaround

HO-COOH edited this page Mar 22, 2026 · 2 revisions

WindowCaptionButtonThemeWorkaround

Properties (WinUI3 IDL)

Name IsDependencyProperty Description
Window Microsoft.UI.Xaml.Window property.

When you have Window.ExtendsContentIntoTitleBar(true), the caption buttons often comes out with broken color regarding to theme. This helper fixed it by working as a hidden control and listens to theme change message, and make corresponding changes to caption buttons.

To use, simply put it under a Xaml control (such as Grid) that can accept child contents.

<Window>
    ...
    <Grid x:Name="RootGrid">
        <essential:WindowCaptionButtonThemeWorkaround Window="{x:Bind}" />
        <-- Other contents -->
    </Grid>
</Window>
Before After

Clone this wiki locally