为什么我的WPF应用程序有拖& Drop禁用(即使AllowDrop为真)? [英] Why my WPF application has Drag & Drop disabled (even when AllowDrop is true)?
问题描述
我试过设置AllowDrop属性(UIElement祖先)在主窗口上为true并包含控件,但根本没有运气,没有拖放事件被触发。
找到原因的任何想法或建议?
已解决
问题是, VisualStudio(运行/调试)阻止了Windows的拖放操作下降机制。运行应用程序是独立的,使其工作,但无法交互调试。
此答案帮助很多:
Visual Studio 2010 WPF项目运行在调试或相关不允许拖放到任何控件
My WPF application inhibits the Drop of files from Windows Explorer, showing a Stop-sign cursor.
I've tried setting the AllowDrop property (that of the UIElement ancestor) to true on the main window and contained controls, but no luck at all, no drag-drop events are fired.
Any ideas or suggestions to find the cause?
Solved!
The problem was that executing my app thru VisualStudio (run/debug) prevented the interop with Windows' drag & drop mechanism. Running the App as stand-alone makes it work, but cannot debug interactively.
This answer helped a lot: Visual Studio 2010 WPF Project ran in debug or relase will not allow drag and drop to any control
这篇关于为什么我的WPF应用程序有拖& Drop禁用(即使AllowDrop为真)?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!