Level Extreme platform
Subscription
Corporate profile
Products & Services
Support
Legal
Français
ComboBox binding to self
Message
General information
Forum:
ASP.NET
Category:
Windows Presentation Foundation (WPF)
Miscellaneous
Thread ID:
01286103
Message ID:
01286473
Views:
32
>
{RelativeSource Self}
can't work in this particular case as your path changes it's value dynamically ;-)

Don't see why it can't work. In fact this works fine:
<ComboBox Width="Auto" Height="Auto" IsSynchronizedWithCurrentItem="True" x:Name="ComboBox" IsDropDownOpen="False" SelectedIndex="0">
   <ComboBox.Foreground>
         <Binding Path="SelectedItem.Foreground">
                <Binding.RelativeSource>
                      <RelativeSource Mode="Self"/>
                </Binding.RelativeSource>
         </Binding>
    </ComboBox.Foreground>
    <ComboBoxItem Content="Apples" Foreground="Red" />
    <ComboBoxItem Content="Oranges" Foreground="Orange"/>
    <ComboBoxItem Content="Pears" Foreground="Green"/>
</ComboBox>
'Longhand' version but it could be stated as an attribute of ComboBox. But admittedly it's a far more convoluted solution than yours <s>
Regards,
Viv
Previous
Next
Reply
Map
View

Click here to load this message in the networking platform