0
votes

I want to visualize a listbox item highlighted when selected, regardless the focus of the parent listbox.

enter image description here

In this example I have two listboxes. In both listboxes the first (and only) element is selected. ListBox 1 does NOT have Focus. ListBox 2 does have focus. I want to have identical highlighting color.

How do I achieve this in a custom listbox / listboxitem style?

1
you must have some XAML. Have you tried anything yet? And could you show us? - Mike
@Mike, well I have the default Style which I am editing. I can copy/paste it in but I don't see much added value in that. I removed the Selector.IsSelectionActive triggers from the default listboxitem style, but that doesn't give the result I am looking for. - bas
it would still be easier to write an answer out of your existing code, instead of guessing what properties have been set. :-) - Mike

1 Answers

0
votes

Found the answer myself in Blend.

    <SolidColorBrush x:Key="Item.SelectedInactive.Background" Color="#3D26A0DA"/>
    <SolidColorBrush x:Key="Item.SelectedInactive.Border" Color="#FF26A0DA"/>
    <SolidColorBrush x:Key="Item.SelectedActive.Background" Color="#3D26A0DA"/>
    <SolidColorBrush x:Key="Item.SelectedActive.Border" Color="#FF26A0DA"/>

I now use the same borders and backgrounds (active / inactive).