Could somebody please explain to me what happens here?
I am creating a binding in code.
The target object is a UserControl
The target property is a boolean DependencyProperty
The source object is a FrameworkElement and implements INotifyPropertyChanged
The source property is of type ObservableCollection
What happens:
The binding is created in code, the result BindingExpressionBase looks fine, the mode is OneWay, the target value gets set correctly (at this time)
Binding b = new Binding();
b.Path = "SourceProperty";
b.Source = SourceObject;
BindingExpressionBase e = this.SetBinding(TargetProperty, b);The source property then gets changed as a result of another databinding. The UserControl tries to fire the PropertyChanged event.
....but nobody is listening. PropertyChanged is null.
I am sure that nothing else is assigned to the target property, so it should still be bound. Why is the binding not listening for the PropertyChanged event?