views:

238

answers:

1

When I configure a ComboBox in XAML, I can configure the ComboBoxItems' background color like so:

<ComboBoxItem x:Name="someName" IsSelected="True" Background="#454545"/>

But how do I do it if the ComboBoxItems come from DataBinding?

A: 

In case of data binding you can customize ItemContainerStyle:

<ComboBox ...>
  <ComBox.ItemContainerStyle>
    <Style TargetType="{x:Type ComboBoxItem}">
     <Setter Property="Background" Value="#454545"/>
    </Style>
  </ComboBox.ItemContainerStyle>
</ComboBox>

Hope this helps.

Cheers, Anvaka.

Anvaka