Drag and Drop control for Silverlight

安稳与你 提交于 2019-12-12 12:17:56

问题


Recently I needed to add drag & drop functionality to a Silverlight application. Can anyone recommend a good drag & drop control?


回答1:


I created a Drag/Drop controller that I think works really well. I have been using this technique for a while, and I have been very happy with it.

http://houseofbilz.com/archive/2009/02/10/drag-and-drop-with-silverlight.aspx




回答2:


Here is a link to the best one I have found so far: http://nickssoftwareblog.com/2008/10/07/silverlight-20-in-examples-part-drag-and-drop-inside-out/

The code is available as a download from the blog post, although you have to rename it to a .zip: http://nickssoftwareblog.files.wordpress.com/2008/10/genericdragdropzip.doc




回答3:


You can try Blacklight Controls which have a really neat drag-dock panel control. Here's a link to a blog describing how it works.




回答4:


I recommend the Silverlight Toolkit for dragging and dropping elements within the same application.

It already has been updated for Silverlight 5.




回答5:


I am guessing you have already found a solution by now. But here is a solution I wrote and am currently using which is very flexible and easy to use: http://sl4dragdrop.codeplex.com/

It works on SL5 very well, all you have to do is add dependency properties on the items or itemscontrol on which you want to enable dragging or dropping.

By default, that is enough. But if you want to customize parts of drag/drop, it gives you interfaces to implement that can control things like Element to drag, Which element to drag from, What image to show while dragging etc.

I have recently refined it a bit and will be posting an update soon after some more testing.



来源:https://stackoverflow.com/questions/829768/drag-and-drop-control-for-silverlight

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!