Hello,
I'm using a horizontal ListBox to display an Enum, but I needed to hide some values similar to the EnumEditBox. To achieve this, I set a Style on the ListBoxItem to hide items when the EditorBrowsable attribute is set to "Never":
<shared:HorizontalListBox.ItemContainerStyle>
<Style TargetType="{x:Type ListBoxItem}" >
<Style.Triggers>
<DataTrigger Binding="{Binding Converter={StaticResource BrowsableToBool}}" Value="False">
<Setter Property="Visibility" Value="Collapsed"/>
</DataTrigger>
</Style.Triggers>
</Style>
</shared:HorizontalListBox.ItemContainerStyle>
This works fine except that the style no longer resembles the default one. I tried using "BasedOn" like this:
BasedOn="{StaticResource {x:Static themes:SharedResourceKeys.ListBoxItemStyleKey}}"
But I haven't found any style like "HorizontalListBoxItemStyle". With "ListBoxItemStyle", it's better but not perfect; the selected item is gray when the control is not focused instead of blue.
Where can I find the base style for items of a HorizontalListBox ?
Thanks,
Benjamin.