Dropping an activity on its parent activity not any where RRS feed

  • Question

  • Hi,

    I'm new to Working in WWF 4.0. My problem here is, I've an Activity called ChildA and it should be dropped only inside of its Parent ie

    if(parentactivity == ParentA) then Drop ChildA

    else stop dropping and throw alert message to user

    Im able to check whether childA is on its own parent or not. But im unable stop its dropping. How to handle STOP dropping of an activity.

    Please HELP me. Its very urgent requirement for me.

    • Moved by edhickey Monday, April 18, 2011 3:21 PM (From:.NET 3.0/3.5 Windows Workflow Foundation)
    Monday, April 18, 2011 12:18 PM

All replies

  • Hi Team,

    I'm very upset till now I didn't get any answer to my question. Please help for above issue. It's an urgent requirement for me. At least give some idea whether this can be achievable or not.

    Tuesday, April 19, 2011 9:29 AM
  • WF designers are WPF controls, so you can do this via the standard WPF drag drop eventing model.

    Please see this thread


     and blog post


    to better understand the concepts involved.

    Please note also that even though this community forum sometimes solves people's problems quickly there is no SLA for questions posted here. If you have critical business problems requiring constrained response time, and can afford it, you or your organization might wish to consider engaging Microsoft's professional support offerings via support.microsoft.com.


    Wednesday, April 20, 2011 11:27 PM
  • Thanks for your reply ,

    I was working fine on adding  protected override void OnPreviewDragEnter(DragEventArgs e) method in parent Activity(A) designer class and it is restricting child Activity(B) to drop inside Parent Activity(A).

    But here my requirement is something different

    I Would like to write the in Child Activity such that it cannot be droped in any other custom activities except  its own parent activity

     Ex:  I have two Custo Activity named Activity1 and Activity2

          Now My Activity1 should only be allowed to drop on Activity2 not in other Activities.

      i believe I should handle the code in Activity1 to achieve this,

              Please help me.


    Wednesday, April 27, 2011 2:24 PM
  • I don't think activities are actually notified that they are added as a child to another activity.
    You might need to instead add a wf-designer-global event handler which looks at all drop events inside the designer canvas.

    Wednesday, April 27, 2011 4:14 PM