Selected ListViewItem background colour

WPF Studio, Themes, and Shared Library for WPF Forum

Posted 3 months ago by Jason Williams
Version: 19.1.0683
Platform: .NET 4.7
Environment: Windows 10 (64-bit)
Avatar

Hi,

I'm trying to style a ListViewItem in the Metro Dark theme.

The suggestions on this forum have been dead ends:

  • "Use the default templates you can download from Actipro". Where is this download please?
  • <SolidColorBrush x:Key="{x:Static apthemes:AssetResourceKeys.ListItemBackgroundSelectedNormalBrushKey}" Color="Red"/> (and variartions thereupon) has no effect.

I've tried various style/template approaches but nothing affects the selected colour. I can override the style of everything else, so I know I'm applying styles/resources in the corretc places, but I can't seem to override the selected colour triggers that Actipro has put on the LVI.

Thanks,

Jason

Comments (2)

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

Hi Jason,

I don't see your user account associated with an organization account.  Whoever is listed on the organization account can download the default styles/templates from the organization account page if you have WPF Studio licenses, which I believe your company does.  You'd want to contact the person in your company who normally gives you the license information, since they are likely the one listed on the organization account.  Or have them add you as a contact as well so you can do it yourself.

As for the resource override, I put this in the ResourceDictionary in our sample project's Application.Resources and it works:

<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ListItemBackgroundSelectedNormalBrushKey}" Color="LightCoral"/>
<SolidColorBrush x:Key="{x:Static themes:AssetResourceKeys.ListItemBackgroundSelectedFocusedBrushKey}" Color="Red"/>

I think the confusion might have been that the resource key you mentioned is for a selected non-focused item.  Whereas the Focused key is for a selected focused item.


Actipro Software Support

Posted 3 months ago by Jason Williams
Avatar

Thanks. (Maybe you could consider adding the templates next to the samples in the installer?)

Unfortunately those brushes don't work for me. The theme is set to the user's preference on startup, so perhaps it's overwriting the custom brushes each time the theme is changed.

I'll see if I can get my hands on the templates and then I should be able to sort it.

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