简体   繁体   中英

Silverlight Drag and drop custom controls

I want to create a drag and drop functionality in my silverlight 3.0 project.

I use Nov 2009 release of the silverlight toolkit.

I created several custom user controls and want to apply drag and drop functionality to them.

I checked using

ListBoxDragDropTarget

with a ListBox but found that it must be bound to some data source.

is there a way to put my custom controls inside the list box and achieve the drag-drop behaviour ?

thanks

You can inherit your control from DragDropTarget. Let say you want to create TextBox and you want to drop items from DataGrid. Then you create

public class DropingTextBox : DragDropTarget<DataGridRow,TextBox>{}

Then you can override methods of DragDropTarget.

Please write what you want to do so maybe I can help more. What behaviour you want to acheive?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM