locked
how can i make "allowdrop = false" work RRS feed

  • Question

  • i host several workflow designers in wpf. and i make some custom activities. now i can drag & drop acitivities into the workflow designers.

        there is a special activity, i want to make it just can be drop into another activity, but cant be dropped into anywhere else. the target activity i use WorkflowItemPresenter in the xaml, so it can be a dropped target.

        and now i can listen to the event called PreviewDrop or PreviewDragOver, and i set the AllowDrop Property into false. but i still can drop activity into the target……

    Could you help me solve my problem?

    Monday, December 13, 2010 2:30 PM

Answers

  • allowdrop is used for the container, ex, you create a custom flowchart, you implement the drop function of the flowchart, you can use allow drop to define what kind of child activities allowed to be drop into the designer.

    for the function you described, you can just use previewdrop or previewdragover.

    if you can operate the container, you can use allowdrop(typeof(specialactivity)) == false

    • Proposed as answer by Tim Lovell-Smith Thursday, December 16, 2010 12:00 AM
    • Marked as answer by Andrew_Zhu Tuesday, December 21, 2010 1:42 AM
    Tuesday, December 14, 2010 3:31 AM