ValueConverter not being invoked in DataTemplate binding
Posted
by unforgiven3
on Stack Overflow
See other posts from Stack Overflow
or by unforgiven3
Published on 2010-04-23T18:31:14Z
Indexed on
2010/04/23
18:33 UTC
Read the original article
Hit count: 279
I have a ComboBox
that uses a DataTemplate
. The DataTemplate
contains a binding which uses an IValueConverter
to convert an enumerated value into a string. The problem is that the value converter is never invoked.
This is my XAML:
<ComboBox ItemsSource="{Binding Path=StatusChoices, Mode=OneWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource StatusToTextConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
Is my binding not correct? I thought this is how one implicitly binds to the value a DataTemplate
is presenting. Am I wrong?
© Stack Overflow or respective owner