Tag: CustomControl

Custom Silverlight TextBox control that immediately updates DataBound Text property in TwoWay binding

Standard Silverlight TextBox control is very useful but has one strange behavior: if you use TwoWay data binding and bind some property to controls Text property, when users type text into the control, this change is not propagated to the bound property until the control loses its focus. This can be very annoying if you have MVVM application and you have some kind of real-time filter that needs to update some data as-you-type. Problem is that TextBox control does not call BindingExpression.UpdateSource when its Text property is changed so we have to do that manually in order to fix this…