WPF : Reorder WrapPanel content via drag and drop?

五迷三道 提交于 2019-12-03 00:49:44

I've written a library which may help: default behaviour is to allow re-ordering within the same control:

http://code.google.com/p/gong-wpf-dragdrop/

Ah I notice you're talking about just a WrapPanel: you'll need to use an ItemsControl with a WrapPanel:

<ItemsControl.ItemsPanel>
    <ItemsPanelTemplate>
        <WrapPanel />
    </ItemsPanelTemplate>
</ItemsControl.ItemsPanel>

A wrap panel won't give you the functionality you are looking for since it is just for layout. Instead look at adding the drag and drop functionality to a ListBox and change the ItemsPanelTemplate of that ListBox to use a wrap panel.


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