Changing the theme Aero and back does not change the back Close, Minimize, Maximize buttons

Ribbon for WPF Forum

The latest build of this product (v25.1.1) was released 3 months ago, which was before this thread was created.
Posted 2 days ago by Daniel Constantin - ModuleWorks GmbH
Version: 25.1.1
Avatar

Hi!

I have an application and the default theme is White.

If I change the theme to Aero or to a Office 2010 theme and back to White the Close, Minimize, Maximize buttons remains having the Aero or Office 2010 theme style.

Kind regards,

Daniel

Comments (2)

Answer - Posted 2 days ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Daniel,

The buttons should be updating styles on theme changes and we haven't been able to reproduce that issue.  Our control template for the Window class uses Buttons for the title bar buttons and we specifically reference the Style to use like this:

Style="{DynamicResource {x:Static themes:SharedResourceKeys.WindowTitleBarButtonBaseStyleKey}}"

Aero and non-Aero themes have separate Style and template definitions for WindowTitleBarButtonBaseStyleKey.  However the appropriate one should be applied per above on theme changes.

In the past, you mentioned you are running a MFC application.  Interoping WPF in other application frameworks has occasionally seen oddities occur in areas like themes, airspace, and focus.  I wonder if that MFC infrastructure is somehow causing the problem here, since it always has worked in pure WPF apps.  As a workaround, perhaps you could try to locate the buttons in the visual tree (look for Buttons with the attached WindowChrome.ElementKind property values of MinimizeTitleBarButton, RestoreTitleBarButton, MaximizeTitleBarButton, CloseTitleBarButton), and try to update their Style properties manually?


Actipro Software Support

Posted 6 hours ago by Daniel Constantin - ModuleWorks GmbH
Avatar

Hi!

The problem was:

I have one executable and one assembly.

In the executable I have the ribbon window and in assembly I have everything else (a custom control with the ribbon and everything).

It seems that I need to do ThemesAeroThemeCatalogRegistrar.Register(); inside the executable and not inside the assembly so that the ribbon window buttons to work correctly.

Kind regards,

Daniel

Add Comment

Please log in to a validated account to post comments.