Programmatically adding a child activity from the activity designer

A child activity can be added to a composite activity using the composite activity’s designer object using the following method
This is useful when you have to add a specific child or a bunch of children based on an designer verb, (  e.g. using context menu).

This entry was posted in Uncategorized. Bookmark the permalink.

2 Responses to Programmatically adding a child activity from the activity designer

  1. Unknown says:

    Hi, I\’ve a problem with a creation of an activity derived from StateActivity. In particular I need to rehost a desginer to permit the end user to create a state machine workflow using my state activity. My state activity must have one StateInitializationActivity, one EventDrivenActivity and one StateFinalizationActivity. To add these I use ComponentAdded event of my WorkflowView as IComponentChangeService. I works … until I used a custum designer (derived from FreeformActivityDesigner) for my stateactivity.Making this, I\’ve a problem: this child activity aren\’t painted … so I can\’t use those on designer (for example to add activities or setstate in EventDrivenActivity).I try to use base.PaintContainedDesigners( e ) in the OnPaint event (before or after paint the stateactivity) without success.Do you know how can I do it work?Thank you.Bye, Nicola Milani

  2. Ramrajprabu says:

    Hi Nessun,
     The InserActivities is a better approach to insert these child activities you are talking about. have you given that a try? you can try to do in the Initialize() of your custom designer.

Leave a Reply to Ramrajprabu Cancel reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s