Confused on theming, can I do this?

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 13 years ago by Adam Petaccia
Version: 10.2.0531
Avatar
In the actipro sample browser, it shows how one could theme a custom widget. How could I theme standard widgets (like Window)?

Also, it seems to use styles. What implications would this have for styles which are set locally? Say I have a theme which sets background color and fontface on Window and I apply a style locally to a window which sets a different background color? Would this override the theme style and I lose the fontface, or would they be merged where I get custom background color and the themed fontface?

Comments (4)

Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hi Adam,

Our theme system at its core is simply swapping in resource dictionaries into the Application.Resources. So in the Common.xaml file for this sample, you could put in styles that target native controls. Those are called implicit styles.

If you explicitly set the Style property to a Style (what we call an explicit style), then that will prevent any other implicit style (such as those set in the resources) from being applied at all. It's as if the implicit style was never available in that case.

One suggestion we have for you is to have the implicit style defined with an x:Key and then base the style you explicitly set on that implicit style (via BasedOn with a StaticResource).

You can google implicit styles to find a lot of posts on how the Styles system works in WPF.


Actipro Software Support

Posted 13 years ago by Ernst Huber
Avatar
Sorry asking such a dumb question, but I'm very new to WPF (and yes, I do read documentation, but maybe I can get a quick start here regarding theming).

Currently I'm evaluating the Actipro WPF controls. As a starter I wrote a test app with just the AnimatedProgressBar, which should have the theme as seen in the Actipro sample browser (Vista Aero style). But without customization the progress bar looks like the native one. My question therefore is: Could anybody give me step-by-step instructions for how to change the look of the progress bar control: which files must be in included in my Visual Studion project, which properties must be applied to the control, and the like.

Thanks in advance for any support!
Regards
Ernst

[Modified at 11/09/2010 11:05 AM]
Posted 13 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar
Hello,

By default the theme of the AnimatedProgressBar will match the system theme. You can change this to one of our other built-in themes using ThemeManager.CurrentTheme. Our documentation explains how to set this, and our Sample Browser has an example as well.

If you are trying to build a custom theme, then please let us know.


Actipro Software Support

Posted 13 years ago by Ernst Huber
Avatar
Thank you, works fine, just one line of code needed:

ThemeManager.CurrentTheme = CommonThemeName.Office2007Blue.ToString();
But there still are many open questions about how to style a WPF app, has quite a steep learning curve.
The latest build of this product (v24.1.1) was released 1 month ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.