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.
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.
I found the answer on how to get the selected activity Selection sel = x.Context.Items.GetValue();