Skip to content

[Mac Catalyst][Windows] TitleBar not reacting on UserAppTheme changes #30518

@bartlomiejsawarski

Description

@bartlomiejsawarski

Description

I'm using TitleBar without setting BackgroundColor (I would like to stay with system default colours). When I change theme using system settings TitleBar correctly responds to this changes. But when I change UserAppTheme TitleBar colour won't be updated (even after app restart)

macOS_example.mov
windows_example.mov

Steps to Reproduce

  1. Create empty MAUI solution
  2. Add buttons which on click would set for example Application.Current.UserAppTheme = AppTheme.Dark;
  3. In App.xaml.cs change CreateWindow to:
    protected override Window CreateWindow(IActivationState? activationState)
    {
        var window = new Window(new AppShell());
        
        window.TitleBar = new TitleBar
        {
            Title = "MauiApp1",
            Subtitle = "Welcome to .NET MAUI",
            ForegroundColor = Colors.White,
            HeightRequest = 32
        };
        
        return window;
    }

I'm using Microsoft.Maui.Controls 9.0.81

Link to public reproduction project repository

No response

Version with bug

9.0.10 SR1

Is this a regression from previous behavior?

Not sure, did not test other versions

Last version that worked well

Unknown/Other

Affected platforms

macOS, Windows

Affected platform versions

No response

Did you find any workaround?

No response

Relevant log output

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions