I'm going in the opposite direction of @Praetorian.
Your TextBox
has a default UpdateSourceTrigger
value of LostFocus
. This means the value is only pushed to your ViewModel property when.. it loses focus.
You can set the UpdateSourceTrigger to PropertyChanged:
<TextBox UpdateSourceTrigger="PropertyChanged" Text="{Binding TextViewModelProperty}" />
From http://msdn.microsoft.com/en-us/library/system.windows.data.binding.updatesourcetrigger.aspx:
One of the UpdateSourceTrigger values.
The default is Default, which returns
the default UpdateSourceTrigger value
of the target dependency property.
However, the default value for most
dependency properties is
PropertyChanged, while the Text
property has a default value of
LostFocus.
Keep in mind this means that anything that is trigger by an update to this property will happen much more frequently (basically with every keypress, instead of a single "flush" when the TextBox
loses focus).
Hope that helps!