Module loading and workflow designer

Oct 20, 2009 at 3:21 PM

Hello all,

Looking for some basic advice on using composite guidance in conjunction with re-hosting the WF workflow designer.  Basically, I have a module which contains a UserControl that encapsulates the re-hosted workflow designer.  One of the things in this control is a System.Activities.Design.ToolboxControl.  In XAML, the basic control is populated with all of the standard activities like If, Parallel, WriteLine, etc.  Now I would like to allow various other contributors to create their own modules that contain additional custom activities and have them appear in my designer simply by dropping these modules in the .\modules folder (i'm using the directory method of populating my catalog).  So my question is, what might be the best approach, in the Initialize() method of these custom modules, to making the custom workflow elements show up in the toolbox of my designer.  I guess i need to do some magic with regions and items around the toolbox control?




Oct 20, 2009 at 6:50 PM

I'm thinking maybe service might work here?  IActivityRegistration would allow custom modules to register their activities and associated designers.  The shell would implement a simple container to hold a list of custom activities and the module that contains the re-hosted workflow designer would just read this dictionary on start up and add each of the custom activities to it's toolbox.


Oct 22, 2009 at 5:39 PM

Hi Bill,

A possible approach to achieve this kind of functionality could be having regions inside the UserControl (view) that contains the basic controls. Then each of the modules could add their own views to those regions (in this case the views would be other custom activities) which will allow you the flexibility of adding different custom activities based on the modules you load.

The UI Composition quickstarts (View Discovery & View Injection) use a view which constains a region (EmployeesView), so you might find them useful to start with.

Please let me know if this helps.

Damian Schenkelman