Theme Rendering

Add-in Express™ Support Service
That's what is more important than anything else

Theme Rendering
 
Subscribe
Alex Carter




Posts: 59
Joined: 2019-02-21
Good Morning,
We are just revisting the theming of our plugin due to issues with the "system default" option.

We have moved everything into a hosted WPF content control on the WinForm to aid with previous scaling issues.

I am just wondering if there's any best practices or guidelines on styling the WPF/WinForm to make it look the same as the currently selected office theme?

We've set the AdxOlFormsCollectionItem "UseOfficeThemeForBackground" property to true. We've then set the WPF hosted contents background to transparent. This takes care of background colours correctly.

The main issues we face is with styling of the controls in the WPF content. These do not get automatically styled when changing the office theme. Is it a case of manually going through each theme, creating a set of brushes based on that theme, then applying those when a theme is changed? Or is there a better solution for this? I wonder if someone has already done this work too.

Thanks for any advice.
Alex
Posted 15 Apr, 2024 11:31:49 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Alex,

You should use the OfficeColorScheme property and the OfficeColorSchemeChanged event that the ADXAddinModule class provides.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 15 Apr, 2024 16:32:07 Top
Alex Carter




Posts: 59
Joined: 2019-02-21
Thanks Andrei,
I'm already making use of the OfficeColorScheme property and OfficeColorSchemeChange event to work out what the current theme is set to.

I was wondering if there was anything for setting the background/foreground colours of controls inline with the theme? Or would it be a case of going through each theme, working out the relevant colours, and then applying those based on the theme that's currently selected?
Posted 16 Apr, 2024 10:53:26 Top
Andrei Smolin


Add-in Express team


Posts: 18833
Joined: 2006-05-11
Hello Alex,

Alex Carter writes:
Or would it be a case of going through each theme, working out the relevant colours, and then applying those based on the theme that's currently selected?


This is the case.

Regards from Poland (GMT+2),

Andrei Smolin
Add-in Express Team Leader
Posted 16 Apr, 2024 18:37:48 Top