I think like @sumitkm... you can't raise an even handler in this scope... I have a question for you, Why do you raise an event? you'r managing an TaskChanged event and I suppose you can perform what you want in this procedure.
–
BermudilloNov 4 '13 at 13:33

2 Answers
2

I think the problem is the name of your DependencyProperty "TaskChangedEventPropertyEvent".

Here's the naming convention:

"The naming convention of the property and its backing
DependencyProperty field is important. The name of the field is always
the name of the property, with the suffix Property appended."

Link to MSDN
So you should change the actual Property "TaskChangedEventProperty"'s name to "TaskedChanged" for example and then change the name of your DependencyProperty "TaskChangedEventPropertyEvent" to "TaskedChangedProperty".

What's preventing you from doing the 'stuff' in the onTaskChange_Invoked event? In other words where is the taskFromSPTaskActivity implemented?

If the event handler is not in scope of the WF runtime it will never be called.

If you are trying to implement a 'Raise External Event' and 'Handle External Event completed' type of scenario where the event completion is triggered by some factor external to the WF runtime (like button push on a page or some other SP List event), you will probably need to have two activities, one to Raise the Event (Subclass System.Workflow.Activities.CallExternalMethodActivity) and other to handle the event (Subclass HandleExternalEventActivity). Then glue these two together using a Service.