UWP GridView/ListView:可以修改拖放响应能力吗?
我正在寻找一种修改(UWP)ListView和GridView的内置拖放行为的两个特定视觉方面的方法。
首先,在尝试重新订购项目时,UI反应之前会有一个延迟。在重新订购动画视觉效果开始之前,您需要在短时间内将项目持有另一个项目(也许是几百毫秒)。
其次,需要拖动项目以触发重新排序响应的阈值/距离相对较大。如果所讨论的项目很小,这并不是一个典型的情况,尤其是对于GridView项目而言。
这两个因素在一起可能会使UI响应能力感觉相当笨拙。有时,UI甚至将相邻的物品集成在一起。
假设这是可能的,我想做的就是删除动画启动延迟并缩短阈值触发距离。但是我找不到影响这些特定方面的任何属性。我尝试删除或修改主题过渡,但没有效果。我还尝试了各种尺寸/边距/填充/等。组合以及选择和拖放/重新排序属性值的不同组合。
这是一个简单的示例来证明这种行为。 (在Win11和Win10上进行了测试。)
<GridView CanDragItems="True" CanReorderItems="True" AllowDrop="True">
<Rectangle Height="100" Width="100" Fill="Red"/>
<Rectangle Height="100" Width="100" Fill="Blue"/>
<Rectangle Height="100" Width="100" Fill="Green"/>
<Rectangle Height="100" Width="100" Fill="Yellow"/>
<Rectangle Height="100" Width="100" Fill="Purple"/>
<Rectangle Height="100" Width="100" Fill="Orange"/>
</GridView>
谢谢!
I'm looking for a way to modify two particular visual aspects of the built-in drag and drop behavior for (UWP) ListView and GridView.
First, when trying to reorder items, there is a delay before the UI reacts. You need to hold an item over another for a short time (maybe a few hundred ms) before the reorder animation visuals begin.
Second, the threshold/distance an item needs to be dragged to trigger the reorder response is relatively large. It's less noticeable if the items in question are very small, but that's not a typical scenario, especially for GridView items.
These two factors together can potentially make UI responsiveness feel rather clunky. At times, the UI even lumps adjacent items together.
Assuming it's even possible, what I would like to do is remove the animation start delay and shorten the threshold trigger distance. But I haven't been able to find any properties that influence these particular aspects. I've tried removing or modifying the theme transitions, but it had no effect. I also experimented with various size/margin/padding/etc. combinations, as well as different combinations of selection and drag/reorder property values.
Here's a simple example to demonstrate this behavior. (Tested on Win11 and Win10.)
<GridView CanDragItems="True" CanReorderItems="True" AllowDrop="True">
<Rectangle Height="100" Width="100" Fill="Red"/>
<Rectangle Height="100" Width="100" Fill="Blue"/>
<Rectangle Height="100" Width="100" Fill="Green"/>
<Rectangle Height="100" Width="100" Fill="Yellow"/>
<Rectangle Height="100" Width="100" Fill="Purple"/>
<Rectangle Height="100" Width="100" Fill="Orange"/>
</GridView>
Thanks in advance!
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我不得不说,没有这样的API可以编辑启动延迟并缩短阈值触发距离,它是内部的,如果您想编辑此内容,请继续向Windows Feffback Hub应用程序发送您的要求。您可以在“开始”菜单中找到反馈中心。请选择开发人员平台 - &gt; API反馈作为提交请求时的类别。相关团队将检查请求。
I have to say there is no such api could edit start delay and shorten the threshold trigger distance, it is internal, if you do want to edit this, please go ahead send your requirement with windows feedback hub app. You could find the Feedback Hub in the Start Menu. Please select Developer Platform->API Feedback as the category when you submit your request. The related team will check the request.