我在uwp中实现了使用拖放来重新排序堆栈面板子,但我不希望堆栈面板子在拖放时离开堆栈面板,那么我该如何实现这一点呢?
我不得不说,拖放api不能为stackpanel实现这样的功能,我们建议你使用列表视图来代替包含CanReorderItems属性。你可以将它设置为true来拖动项目到你想要的索引
<ListView CanDragItems="True" CanReorderItems="True" AllowDrop="True"
SelectionMode="Single" />