0

I use the Adonis UI black theme for my styles and it makes all controls look great.

Now, for a ListBox I need to add a custom style

 <ListBox.ItemContainerStyle>
       <Style TargetType="ListBoxItem">
            <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
       </Style>
 </ListBox.ItemContainerStyle>

but this removes some of the Adonis UI style from the ListBoxItem (the white font to be precise).

I also tried adding the style to my ResourceDictionary:

<ResourceDictionary>
   <Style TargetType="{x:Type ListBoxItem}">
      <Setter Property="HorizontalContentAlignment" Value="Stretch"/>
   </Style>
</ResourceDictionary>

and

  <Application.Resources>
    <ResourceDictionary>
        <ResourceDictionary.MergedDictionaries>
            <ResourceDictionary Source="pack://application:,,,/AdonisUI;component/ColorSchemes/Dark.xaml"/>
            <ResourceDictionary Source="pack://application:,,,/AdonisUI.ClassicTheme;component/Resources.xaml"/>
            <ResourceDictionary Source="ResourceDictionary.xaml"/>
        </ResourceDictionary.MergedDictionaries>
    </ResourceDictionary>
</Application.Resources>

But that doesn't work at all.

How can I combine those Styles?

TimR
  • 1

0 Answers0