Custom args class in event from custom activity?
Hi
I have created a custom activity PageDeleted (inherits fromSequenceActivity). In it I expose a event like
publicstaticDependencyProperty PageDeletedEvent =DependencyProperty.Register("PageDeleted",typeof(EventHandler<ExternalDataEventArgs>),typeof(DeletingPage));publiceventEventHandler<ExternalDataEventArgs> PageDeleted{
add{
this.AddHandler(DeletingPage.PageDeletedEvent,value);}
remove{
this.RemoveHandler(DeletingPage.PageDeletedEvent,value);}
}
and I raise the event like:
this
.RaiseEvent(DeletingPage.PageDeletedEvent,this, e);where e is of type ExternalDataEventArgs.
When I test this activity in a workflow I notice that even if I bind to the event my delegate in workflow never gets called when I call RaiseEvent from activity.
But if I change the argument type from ExternalDataEventArgs to standard EventArgs like:
publicstaticDependencyProperty PageDeletedEvent =DependencyProperty.Register("PageDeleted",typeof(EventHandler),typeof(DeletingPage));[
ValidationOptionAttribute(ValidationOption.Required)]publiceventEventHandler PageDeleted{
add{
base.AddHandler(DeletingPage.PageDeletedEvent,value);}
remove{
base.RemoveHandler(DeletingPage.PageDeletedEvent,value);}
}
then I get called as expected in my delegate in the workflow. Does anybody know the reason for this behaviour?
