void PropertyPathValueChanged (object o, EventArgs EventArgs)
{
string dataError = null;
Exception exception = null;
// If we detach the binding, we set the Source of the PropertyPathWalker to null
// and emit a ValueChanged event which tries to update the target. We need to ignore this.
if (!Attached)
return;
var node = PropertyPathWalker.FinalNode;
AttachToNotifyError (node.Source as INotifyDataErrorInfo);
if (!Updating && Binding.ValidatesOnDataErrors && node.Source is IDataErrorInfo && node.PropertyInfo != null)
dataError = ((IDataErrorInfo) node.Source) [node.PropertyInfo.Name];
bool oldUpdating = Updating;
try {
Updating = true;
Invalidate ();
Target.SetValueImpl (Property, this);
} catch (Exception ex) {
if (Binding.ValidatesOnExceptions) {
if (ex is TargetInvocationException)
ex = ex.InnerException;
exception = ex;
}
}
finally {
Updating = oldUpdating;
}
MaybeEmitError (dataError, exception);
}