locked
Workflow 4.5 with custom activities RRS feed

  • Question

  • I created a number of custom activities in a rehosted designer.  What I have seen is that when I add another activity my activity  constructor is called again.  In my activity constructor I set a view model to associate a dialog and this causes the view model to not match the model item associated with the Activities.

    The revelant code is:

                     public InstructionDesigner()

                     {

                              InitializeComponent();

                              infoDialogViewModel = new InfoDialogViewModel();

                     }

     

    Where the designer constructor creates the view model but being called twice when I add a new activity.  If I add another activity beyond the second activity I am only constructing one.  It looks like when I add the second activity it is reconstruction the original activity and putting a sequence activity around it.

    How should I handle this or is there a work around so I can attach a viewmodel to a specific instance of the activity.

    Tuesday, March 10, 2015 12:42 AM

All replies