views:

902

answers:

1

I've got a container, say a Grid. It has two containers, say StackPanels.

StackPanel #1 has some rectangles. What's the best way to enable a user to drag a rectangle and drop it in the StackPanel #2 (and have that rectangle be a child of StackPanel #2).

I've got the drag bit sussed - the only thing that's unclear is whether to actually use containers or just handle all the rectangles manually in a straight canvas.

+1  A: 

As far as the logic behind actually moving the items goes, a StackPanel as a container is just fine. If you want to preview the item whilst it's being dragged, you can implement an Adorner that displays the Visual whilst it is being dragged.

HTH, Kent

Kent Boogaart