1
votes

Greetings,

I need to be able to drag and drop items that's contained in a Border. So far I managed to find the border on the MouseLeftButtonDown event. Now I wish for the item to move with the mouse when I have my mousebutton down.

I assume this can be done by simple settinga bool "dragging" to true when the item is clicked and then handle the moving in the MouseMove event.

But I can't seem to figure out how to move the item. Border doesn't have a property as Position or Location. Is there any way I can achieve what I want?

Perhaps there are controls for it that I dont know of?

Bit more background information:

I'm showing multiple columns (each column is a new canvas) with rows in it. Each row and canvas represent a cell. In a some cells I have a border containing a textblock with information. Upon clicking this border I wish for it to be bound to my mouse and move where I move my mouse.

1

1 Answers

1
votes

I would recommend you use the Silverlight Toolkit which contains a framework for doing this sort of drag and drop work. Once installed open the documentation and lookup the PanelDragDropTarget control.