Hi,
>It's acutally even the better solution. You can shorten it like this:
>
>
><ComboBox Width="Auto" Height="Auto" x:Name="ComboBox" IsDropDownOpen="False" SelectedIndex="0"
> Foreground="{Binding RelativeSource={RelativeSource Self}, Path=SelectedItem.Foreground}">
> <ComboBoxItem Content="Apples" Foreground="Red" />
> <ComboBoxItem Content="Oranges" Foreground="Orange"/>
> <ComboBoxItem Content="Pears" Foreground="Green"/>
></ComboBox>
>
>
>The reason why this solution is better than using ElementName is flexibility: imagine you would use this combobox as a ListBoxItem and every item should have a different name in order to make the binding working. By a RelativeSource binding this would work, too.
Good point - although it wasn't a factor in my scenario. Thanks for clarifying the shorter version - it's what I was originally fumbling for but couldn't get right...
Best,
Viv