I’m trying add data triggers to the default combobox style so each text item in the drop down box will be assigned a different color, and the selected item will be that color too. I have successfully been able to color code the text column items in my datagrid by using this xaml code:
<DataGrid ...>
<DataGrid.Columns>
<DataGridTextColumn ...>
<DataGridTextColumn.CellSyle>
<Style TargetType="DataGridCell">
<Style.Triggers>
<DataTrigger Binding="{Binding Path=Status}" Value="Accepted">
<Setter Property="Foreground" Value="Green"/>
</DataTrigger>
<Style.Triggers>
</Style>
</DataGridTextColumn.CellStyle>
</DataGridTextColumn>
</DataGrid.Columns>
</DataGrid>
But I cannot figure out how to do this for the combobox. Can someone please help?
Try this: