WPF-拖放放到清单方块ITEM [英] WPF - Drag & Drop on Listbox ITEM

查看:81
本文介绍了WPF-拖放放到清单方块ITEM的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我不想在整个ListBox上放一些东西,而是在特定的ListBoxItem上放东西。我正在处理ListBox的Drop事件-如何找到鼠标指向的项目?

I want to drop something not on the whole ListBox, but on a specific ListBoxItem. I'm handling the ListBox' Drop event - how can I find out, on which item the mouse is pointing?

推荐答案

I设法通过不在列表框上而是在ItemTemplate中的控件上设置 AllowDrop Drop 事件处理程序来解决此问题

I managed to solve this now by setting AllowDrop and the Drop event handler not on the ListBox but to the control in the ItemTemplate.

这篇关于WPF-拖放放到清单方块ITEM的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆