How to apply an Actipro theme to custom controls, and use overriden styles?

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 7 years ago by Craig - Varigence, Inc.
Version: 12.2.0572
Avatar

1. Our solution has a WPF application project and a library DLL that includes custom WPF user controls. If I follow the getting started steps to set an application-wide theme to my WPF application, will that theme be automatically applied to any user controls loaded from the referenced library DLL?

2. After reading the documentation, I'm still unclear on how I can override an Actipro theme's default styles in XAML. For instance, let's say I wanted to alter a button's default style to include some attached behaviors. 

Would the style look like this?

<Style
    TargetType="{x:Type Button}"
    BasedOn="{StaticResource ButtonBaseStyleKey}"
    >
...
</Style>

3. Let's say I have a XAML file that includes overriden default styles in my application project. How I can apply those styles to my application? Should the file be referenced as a ResourceDictionary in the application's App.xaml file?

Thanks,

-Craig

Comments (1)

Answer - Posted 7 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Craig,

1) Our themes get installed into the application's Resources so yes, they should be available to anywhere n your application.

2) The BasedOn would have to be one of the styles we provide (like {x:Static themes:SharedResourceKeys.ButtonBaseStyleKey} ), but that should work.

3) You can include your .xaml in the app Resources as well.  I believe we do our best to install our themes before other things that are there so that you are able to override them.


Actipro Software Support

The latest build of this product (v2019.1 build 0683) 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.