Skip to content

Commit

Permalink
Fixed issue with INotifyPropertyChanged proxy that the event target w…
Browse files Browse the repository at this point in the history
…as the wrong object
  • Loading branch information
jbogard committed Mar 19, 2010
1 parent eded6f8 commit c518961
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/AutoMapper/Internal/NotifyPropertyBehaviorInterceptor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -24,15 +24,15 @@ public override void Intercept(IInvocation info)

if (IsSetterCall(info))
{
OnPropertyChanged(new PropertyChangedEventArgs(GetPropertyName(info)));
OnPropertyChanged(info.Proxy, new PropertyChangedEventArgs(GetPropertyName(info)));
}
}

protected virtual void OnPropertyChanged(PropertyChangedEventArgs e)
protected virtual void OnPropertyChanged(object target, PropertyChangedEventArgs e)
{
var handler = PropertyChanged;
if (handler != null)
handler(this, e);
handler(target, e);
}
}
}
1 change: 1 addition & 0 deletions src/UnitTests/InterfaceMapping.cs
Original file line number Diff line number Diff line change
Expand Up @@ -156,6 +156,7 @@ public void Should_notify_property_changes()
var count = 0;
_result.PropertyChanged += (o, e) => {
count++;
o.ShouldBeTheSameAs(_result);
e.PropertyName.ShouldEqual("Value");
};

Expand Down

0 comments on commit c518961

Please sign in to comment.