Add custom resource keys to Actipro themes

WPF Studio, Themes, and Shared Library 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 1 days ago by BenjaminLopVic - France
Version: 25.1.1
Avatar

Hello,
I want to add a new global resource key (a new brush) to my application, and I’d like it to change automatically when the Actipro theme changes.
Is it possible to add custom keys to Actipro themes?

I’ve seen the ThemeSamples\ThemeOverride QuickStart, which is great — but it only shows how to modify existing assets, not how to add new ones.

Thanks

Comments (3)

Answer - Posted 22 hours ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Actually that is the correct sample to look at and you can add any resources you want using the techniques in there.  For example. we add a new DialogButtonStyle Style, which isn't a built-in resource from our themes.  You could do the same thing but with a new custom brush.


Actipro Software Support

Posted 9 hours ago by BenjaminLopVic - France
Avatar

I’ll try that! But do you know how to do it in a non-standalone WPF application?
I’m using Actipro in a VSTO application, and I get this error when I try to add it:

Error XDG0008: ResourceDictionary is not supported in a Windows Presentation Foundation (WPF) project.

My project does reference WPF correctly — I can create WPF UserControls without any problem.

Thanks.

Posted 7 hours ago by BenjaminLopVic - France
Avatar

Also, I tried this in a standalone WPF application, and I couldn’t get it working there either.
I’m using three different ThemeDefinitions — OfficeBlack, OfficeGray, and OfficeWhite — each with an associated ThemedResourceDictionaryReference.

But my CustomBrush doesn’t use the correct dictionary:

  • The black and gray themes both use the white dictionary,

  • And the white theme doesn’t use any of them.

You can find the full code here: github.com/BBJ-Artecomm/ActiproThemeSample
Thanks!

Add Comment

Please log in to a validated account to post comments.