Add new AssetKey to existing themes

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 6 years ago by Hagay
Version: 17.2.0664


I'm using both Metro-White and Metro-Dark themes in my application (I let the user choose between them dynamically).

I would like to set a new Asset that will be used by the AdvancedTextBlock.HighlightBackground property and will change according to the selected theme.

What is the right and easy way to accomplish that?


Comments (1)

Posted 6 years ago by Actipro Software Support - Cleveland, OH, USA

Hi Hagay,

Yes you can set the AdvancedTextBlock.HighlightBackground property to a Brush resource you create.  The brush resource could be put in XAML files that get pulled in from a custom theme catalog that you create.  The ThemeSamples\ThemeOverride QuickStart in the Sample Browser shows an example of how to pull in different Brush resource values based on theme.  Please have a look at that.

Actipro Software Support

The latest build of this product (v24.1.2) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.