ValueConverter is not called in DataTemplate binding
I have ComboBox
one that uses DataTemplate
. DataTemplate
contains a binding that is used IValueConverter
to convert the listed value to a string. The problem is that the value converter is never called. If I put a breakpoint at StatusToTextConverter.Convert()
, it never hits.
This is my XAML:
<ComboBox ItemsSource="{Binding Path=StatusChoices, Mode=OneWay}">
<ComboBox.ItemTemplate>
<DataTemplate>
<TextBlock Text="{Binding Converter={StaticResource StatusToTextConverter}}"/>
</DataTemplate>
</ComboBox.ItemTemplate>
</ComboBox>
I thought this is how it implicitly binds to the value of a DataTemplate
. I'm wrong?
Edit: In context: I intend to display Image
in DataTemplate
next to the topic TextBox
. If I can't get the binding TextBox
to work, then I don't think it Image
will work either.
a source to share