Compartilhar via


Tips and Tricks in hosting .NET4 Workflow Designer: how to load a ‘blank’ Activity Builder Designer Grid!

Background: ISVs typically host the Workflow Designer to enable the ITPros use the tool set outside the Visual Studio UI experience.

Problem: While loading a new Designer view in the rehosted Workflow Designer, the method workflowDesigner.Load (new Sequence ()) by default loads an empty Sequence Activity in the Activity Builder designer grid (Figure 1).  In some ISV scenarios, it may be preferred to load a ‘blank’ Activity Builder Designer Grid, so that the ITPro user is not restricted to using the Sequence Activity. Changing the parameters to (null) in the method (as workflowDesigner.Load (null) ); does not help as the Workflow Designer Activity Builder is not loaded.

clip_image001

Figure 1: Rehosted Designer while using Method workflowDesigner.Load (new Sequence ())

Solution: To mimic the Visual Studio Workflow Designer experience use the ActivityBuilder Method as : LoadWorkflowDesigner(new System.Activities.ActivityBuilder()).

clip_image002

Figure 2: Rehosted Designer ActivityBuilder Method as: LoadWorkflowDesigner(new System.Activities.ActivityBuilder())