views:

185

answers:

1

In Silverlight 3:

I've got an object that implements INotifyPropertyChanged

I've got a TextBlock with the Text property bound to a property on my object. However, the property changes and fires the PropertyChanged event, but the TextBlock control never displays the value.

If I change the Mode to TwoWay, it works, but this doesn't make much sense. Is this a bug in Silverlight's TextBlock or a poorly documented feature?

Here's my code (extremely simple) - this doesn't work:

<TextBlock Text="{Binding Code}" />

This does work:

<TextBlock Text="{Binding Code, Mode=TwoWay}" />

And the reason I care about this is that I actually want to bind the Text to an object, not a property, and then use a ValueConverter to do some conversion, so the TwoWay mode doesn't work (I get a XAML parser exception when I try it).

A: 

Could you share the source of your class used as DataContext? I did not have a problem using a binding on TextBlock.

KeithMahoney
Now that I've tried to reproduce this in a very simple way, it's working correctly, which intrigues me. I will have to dig a bit deeper to find out why my specific situation doesn't work.
Craig Shearer