locked
Calling One Custom Activity from Another RRS feed

  • Question

  • We have a custom activity (Activity1) built with the WF4 designer that works great.  Now, what I want to do is call Activity1 from another (Activity2).  Activity2 should set the values for Activity1 and make them read-only.  Activity2 should use the output from Activity1.

    Can't seem to find anything on doing this, but suspect it is possible. 

    Ideas?

    Thanks

    Tuesday, January 3, 2012 1:41 PM

Answers

  • Just build the project with Activity1.xaml. Then when you open Activity2.xaml, you should see that Activity1 appears in the toolbox, (under a category related to its namespace or assembly name). You can then drag Activity1 from the toolbox, the same as any of the standard activities. In order to funnel input and output between the activities you need to add InArguments and OutArguments to Activity1 via the arguments grid.


    Tim

    • Marked as answer by LeoTang Tuesday, January 10, 2012 11:01 AM
    Tuesday, January 3, 2012 10:34 PM

All replies

  • I wasn't quite clear from the question, but are you wanting to do this in Visual Studio or is it a rehosted app?
    Tim

    Tuesday, January 3, 2012 7:06 PM
  • Visual Studio 2010.

    Tuesday, January 3, 2012 7:07 PM
  • Just build the project with Activity1.xaml. Then when you open Activity2.xaml, you should see that Activity1 appears in the toolbox, (under a category related to its namespace or assembly name). You can then drag Activity1 from the toolbox, the same as any of the standard activities. In order to funnel input and output between the activities you need to add InArguments and OutArguments to Activity1 via the arguments grid.


    Tim

    • Marked as answer by LeoTang Tuesday, January 10, 2012 11:01 AM
    Tuesday, January 3, 2012 10:34 PM