Coerce a WPF TextBox not working anymore in .NET 4.0

Try using in xaml Explicit instead of PropertyChanged: <TextBox Text=”{Binding Percentage, Mode=TwoWay, UpdateSourceTrigger=Explicit, TargetNullValue={x:Static System:String.Empty}}” TextChanged=”TextBox_TextChanged” /> and in code behind UpdateSource instead of UpdateTarget private void TextBox_TextChanged(object sender, TextChangedEventArgs e) { // Removed safe casts and null checks ((TextBox)sender).GetBindingExpression(TextBox.TextProperty).UpdateSource(); } Tested it and it works. Btw this problem will probably be resolved in a … Read more

Difference between ObservableCollection and BindingList

An ObservableCollection can be updated from UI exactly like any collection. The true difference is rather straightforward: ObservableCollection<T> implements INotifyCollectionChanged which provides notification when the collection is changed (you guessed ^^) It allows the binding engine to update the UI when the ObservableCollection is updated. However, BindingList<T> implements IBindingList. IBindingList provides notification on collection changes, … Read more

tech