<ComboBox Width="Auto" > <ComboBoxItem Content="Apples" Foreground="Red" /> <ComboBoxItem Content="Oranges" Foreground="Orange"/> <ComboBoxItem Content="Pears" Foreground="Green"/> </ComboBox>by default the value in the combobox when closed does not reflect the relevant ComboBoxItem.Foreground setting. I can fix this in code with:
private void ComboBox_SelectionChanged(object sender, SelectionChangedEventArgs e) { ComboBox.Foreground = ((ComboBoxItem)ComboBox.SelectedItem).Foreground; }But how do I express this as a binding in XAML?