I want to change the background color of the drowpdown panel of the combobox. I'm using WPF. I've read this post
BackgroundColor Items ComboBox WPF
and I've written this code:
<ComboBox
Width="{StaticResource UnityX3}"
styles:Typhography.TypeSize="Body1"
Margin="12 0 0 0"
Foreground="{StaticResource Viola1Brush}"
DisplayMemberPath="AuthorName"
SelectedItem="{Binding Path=ConsoleViewModel.AnswersViewModel.SelectedAuthor}"
ItemsSource="{Binding ConsoleViewModel.AnswersViewModel.Authors}"
Grid.Column="1">
<ComboBox.ItemContainerStyle>
<Style TargetType="{x:Type ComboBoxItem}">
<Setter Property="Background" Value="Blue" />
</Style>
</ComboBox.ItemContainerStyle>
</ComboBox>
I have obtained the result in the picture.
I want that the entire panel is blue, included the little border around the single item. How can I change my code in order to solve my problem? Thank you
What you are seeing is a missing border color of the container. Set the BorderBrush
value to the Blue
for what is needed by the ItemContainerStyle
to remove the White
looking border.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With