gpt4 book ai didi

silverlight - 使用拖放的 Wrap-Panel 记录项目

转载 作者:行者123 更新时间:2023-12-01 06:41:03 24 4
gpt4 key购买 nike

当用户触摸它时,我需要使用拖动来更改 WrapPanel(或具有水平方向的堆栈面板)中项目的位置。

我尝试过 MouseDragElementBehavior,但它仅更改当前项目的位置,而不会更改其他项目的位置。

我看到了 this article但它与垂直方向的 listBox 一起使用。那么是否存在任何方法呢?

最佳答案

WrapPanel 不是用于拖放的完美面板,因为它没有顺序的概念。事实上,项目是根据数据源中的顺序排序的。

使用您的示例,您可以像这样简单地更改 ItemsPanel:

 <rlb:ReorderListBox

...
<rlb:ReorderListBox.ItemsPanel>
<ItemsPanelTemplate>
<toolkit:WrapPanel ItemWidth="100" ItemHeight="50"/>
</ItemsPanelTemplate>
</rlb:ReorderListBox.ItemsPanel>
...

关于silverlight - 使用拖放的 Wrap-Panel 记录项目,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/10277303/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com