I have a custom workflow activity (SharePoint 2010) with a Dependency Property defined as follows:
public static DependencyProperty TaskChangedEventPropertyEvent = DependencyProperty.Register("TaskChangedEventProperty", typeof(EventHandler), typeof(SPTaskActivity));
[Description("TaskChangedEventProperty")]
[Category("TaskChangedEventProperty Category")]
[Browsable(true)]
[DesignerSerializationVisibility(DesignerSerializationVisibility.Visible)]
public event EventHandler TaskChangedEventProperty
{
add
{
base.AddHandler(SPTaskActivity.TaskChangedEventPropertyEvent, value);
}
remove
{
base.RemoveHandler(SPTaskActivity.TaskChangedEventPropertyEvent, value);
}
}
In my parent workflow I have a ReplicatorActivity with:
private void replicateTasks_ChildInitialized(object sender, ReplicatorChildEventArgs e)
{
SPTaskActivity spCreatePortfolioManagerTasks = e.Activity as SPTaskActivity;
spCreatePortfolioManagerTasks.TaskAssignedTo = e.InstanceData.ToString();
// ...
}
and the Event from my Activity hooked up to the following handler which never gets called:
private void taskFromSPTaskActivity(object sender, EventArgs e)
{
//do stuff
}
This event is being raised via the onTaskChanged_Invoked event within the custom activity with:
base.RaiseGenericEvent<EventArgs>(TaskChangedEventPropertyEvent, this,e);
Can anyone provide any assistance/guidance as to why this might not be firing?