Plateforme Level Extreme
Abonnement
Profil corporatif
Produits & Services
Support
Légal
English
ComboBox Binding
Message
De
29/03/2008 09:30:44
 
 
À
29/03/2008 09:25:24
Information générale
Forum:
ASP.NET
Catégorie:
Windows Presentation Foundation (WPF)
Divers
Thread ID:
01306702
Message ID:
01306703
Vues:
3
>Just playing with XAML. I have:
><ComboBox>
>   <ListBoxItem Content="Red" Foreground="{Binding Path=Content , RelativeSource={RelativeSource Self}}"/>
>    <ListBoxItem Content="Orange" Foreground="{Binding Path=Content , RelativeSource={RelativeSource Self}}"/>
>     <ListBoxItem Content="Green" Foreground="{Binding Path=Content , RelativeSource={RelativeSource Self}}"/>
></ComboBox>
which is kinda silly (but neat). But the Foreground color doesn't show up in the ComboBox once an item is selected. Any suggestions?

Yup (obvious really):
<ComboBox  Foreground="{Binding Path=SelectedItem.Foreground , RelativeSource={RelativeSource Self}}">
:-}
Précédent
Répondre
Fil
Voir

Click here to load this message in the networking platform