How to customize the background color of the selected item?

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 11 months ago by Joey Lu
Version: 23.1.0
Avatar

How to customize the background color of the selected item? Take TreeListViewItem as an example:

current theme: MetroDark

selected: light blue

selected and actived: dark blue

current theme: MetroLight

selected: light green

selected and actived: dark green.

Comments (1)

Posted 11 months ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hello,

Our theme generator creates hundreds of brush resources that are used throughout our themes.  The color used for highlights is typically driven by the ThemeDefinition.PrimaryAccentColorFamilyName property, which defaults to Blue.  You can use our Theme Designer application to alter high level theme definition properties.  

If you want to start with our MetroLight or MetroDark themes as a base, then you'd start with a MetroThemeDefinition instance with a custom theme name, and use ThemeIntent.Light or ThemeIntent.Dark.  Then alter other properties on the theme definition and use it to generate the theme.  The Theme Designer's Presets tab lets you select Metro Light and Metro Dark to use as a base.  Alter properties as desired and go to the Code tab to see the code that you should insert into your app startup.

The Theme Designer's Resource Browser tab lets you see the resources that are generated.  If you filter the list by "ListItem" you can see all the brushes that TreeListViewItem (and other lists) will use.  This documentation topic tells you how to customize brushes if you need further customization beyond what our theme definition's properties will generate.


Actipro Software Support

The latest build of this product (v24.1.1) 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.