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?

[4306 byte] By [jbearfoot] at [2007-12-23]
# 1
Try using:

this.RaiseGernericEvent<ExternalDataEventArgs>(DeletingPage.PageDeletedEvent, this, e);

Hope this helps

Christian_Nadeau at 2007-8-30 > top of Msdn Tech,Software Development for Windows Vista,Windows Workflow Foundation...

Software Development for Windows Vista

Site Classified