Question

I am working with a rehosted workflow designer. In my C# code I do have access to the instance of the WorkflowDesigner. How do I get access to the current activity that I am at (the cursor is at ) or I have just opened it. This is the workflow I am referring to:

System.Activities.Presentation.WorkflowDesigner x;

How do I access the current activity or all activities within the x.

The image of a Sequence parent and its two childs

I have tried this as well:

 ModelService modelService = x.Context.Services.GetService<ModelService>();
 Activity a = modelService.Root.GetCurrentValue() as Activity;
 IEnumerable <Activity> MyActivities = WorkflowInspectionServices.GetActivities(a );

when I run this code there is NO activities returned within the root "a" in other words myActivities IEnumerable is empty.

Thanks in advance.

Was it helpful?

Solution

I found the answer on how to get the selected activity Selection sel = x.Context.Items.GetValue();

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top