-
-
Notifications
You must be signed in to change notification settings - Fork 18
EventInvokerSelectionInjection
Charles Grunwald edited this page Jun 11, 2014
·
3 revisions
Event invoker is the method that actually fires the PropertyChanging event. Although it is not part of the INotifyPropertyChanging interface the standard form is as follows
public virtual void OnPropertyChanging(string propertyName)
{
var propertyChanging = PropertyChanging;
if (propertyChanging != null)
{
propertyChanging(this, new PropertyChangingEventArgs(propertyName));
}
}
The name of the event invoker method can be changed (from its default of OnPropertyChanging) using the EventInvokerName property of the WeavingTask.
For example you could use
<Weavers>
<PropertyChanging EventInvokerNames="RaisePropertyChanging"/>
</Weavers>
So in all examples you can exchange OnPropertyChanging with whatever you have selected using EventInvokerNames.
The event invoker call is done as follows
- Try to find a method with the following signature in the class hierarchy (where method name matches
EventInvokerNames)OnPropertyChanging(string propertyName) - If no method is found then the standard OnPropertyChanging code (listed above) is injected.