Sorting through multiple drop targets?

Dec 30, 2010 at 12:28 AM

In this scenario I happen to have several drop targets that overlap on the screen; I want to be able to do certain operations with items in a container, and other things with the container itself. However, when dragging one particular type of item around, I really only want to be able to drop it on the items inside the container, not on the container. What's an appropriate way to do this? I was hoping to restrict the allowable DropTargets list to only acknowledge the appropriate controls I care about, but I don't really know how the syntax for this is supposed to work in XAML, and doing it in the codebehind will be a little bit difficult due to the nature of the data-binding I'm working with.

Does it make sense to disable all unwanted drop targets when a drag-start event fires, and then re-enable them when the drag ends? That's a little clunky but it seems like it might be the easiest thing for this problem.