引用:System.windows.Controls.Toolkit
xmlns:mswindows="clr-namespace:Microsoft.windows;assembly=System.windows.Controls.Toolkit"
然后用ListBoxDragDropTarget套在ListBox外,并设置ItemsPanelTemplate。
----ListBoxDragDropTarget并不能作用于virtualized容器(ListBox的默认容器),所以必须改变ListBox的ItemsPanelTemplate容器,比如说像这样加个StackPanel进去取代virtualized默认容器即可 .
<toolKit:ListBoxDragDropTarget AllowDrop="True"> <ListBox x:name="AcceptListBox" Height="200" WIDth="200" displayMemberPath="name"> <ListBox.ItemsPanel> <ItemsPanelTemplate> <StackPanel OrIEntation="Vertical"/> </ItemsPanelTemplate> </ListBox.ItemsPanel> </ListBox> </toolKit:ListBoxDragDropTarget>
除了ListBoxDragDropTarget控件还有如下控件也支持这种效果:
ListBoxDragDropTarget[已实现]
TreeVIEwDragDropTarget -[实现TreevIEw拖拽]
DataGrIDDragDropTarget-[DataGrID控件支持]
DataPointSerIEsDragDropTarget-[尚未测试.]
原文地址:http://www.cnblogs.com/chenkai/archive/2010/05/26/1744226.html
总结以上是内存溢出为你收集整理的Silverlight 4.0 可拖动排序的ListBox全部内容,希望文章能够帮你解决Silverlight 4.0 可拖动排序的ListBox所遇到的程序开发问题。
如果觉得内存溢出网站内容还不错,欢迎将内存溢出网站推荐给程序员好友。
欢迎分享,转载请注明来源:内存溢出
评论列表(0条)