如何自定义 SurfaceListBox 中多个项目的选择

发布于 2024-10-04 08:15:06 字数 223 浏览 0 评论 0原文

我有一个包含许多项目的 surfaceListBox。 当我将 SelectionMode 设置为 multiple 时,一切都很好,我单击一个项目将其添加到 SelectionItems, 但我想获得相同的行为,但不是点击项目,而是当触摸在项目上移动时, 以下是我要添加的操作的一些细节:

如果触摸在 surfacelistboxitem 上移动,则该项目将添加到 selectedItems 中。 感谢您的帮助

I have a surfaceListBox that contains many items.
when I put the SelectionMode to multiple , every thing is fine and I click on an item to add it to the selectionItems,
But I want to get the same behaviour but not with clicking on the items but when the touch is moving over the item ,
Here is some details of the manipulation I want to add:

if the touch is moving over a surfacelistboxitem , this item is added to the selectedItems .
Thanks for your help

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

南笙 2024-10-11 08:15:06

SurfaceListBox 不支持这一点,因为它需要将移动手指视为滚动。

如果您不需要滚动功能,则可以放弃 SurfaceListBox,转而使用充满 SurfaceToggleButton 元素的 StackPanel。在这些切换按钮上,设置 ClickMode=Hover,以便只需将手指移到它们上方即可进行切换。

-Robert(Surface 控制装置前任 PM)

SurfaceListBox doesn't support this because it needs to treat moving fingers as scrolling.

If you don't need the ability to scroll, you can ditch SurfaceListBox and instead use a StackPanel filled with SurfaceToggleButton elements. On those toggle buttons, set ClickMode=Hover so that they will toggle just by moving your finger over them.

-Robert (former PM for the Surface controls)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文