A few days back, I had blogged about an attached property I wrote to force instant binding in a WPF TextBox. Well it turns out I was having a “duh” moment there and this was pointed out to me very politely by Richard Deeming (a fellow CodeProject author). Turns out all I needed to do was to set the UpdateSourceTrigger on the Binding to PropertyChanged. In fact, this is the very example that’s on the MSDN documentation for UpdateSourceTrigger. Oh well, you live, you learn.
<TextBox Height="23"
Text="{Binding EnteredName, UpdateSourceTrigger=PropertyChanged}"
HorizontalAlignment="Left"
Margin="144,64,0,0" Name="textBoxName"
VerticalAlignment="Top" Width="152" />
I have updated the old blog entry and pointed it to this entry.
One thought on “Correction for the instant binding attached behavior for WPF TextBoxes”