WPF 拖放不适用于空图像
我想允许用户将图像从资源管理器拖放到空的 Image
上(未设置 Source
属性),并且我希望 Image
默认情况下为空,但如果 Image
为空并且我的光标只是一个带有斜线的圆圈,则 Drop
事件将不会触发。我尝试向 Image
添加默认图像,效果很好。有什么办法可以让我完成这项工作或者有任何解决方法吗?
I want to allow the user to drop an image from explorer onto an empty Image
(Source
property not set), and I want the Image
to be empty by default, but the Drop
event will not fire if the Image
is empty and my cursor will just be a circle with a slash. I tried adding a default image to the Image
and it worked just fine. Is there any way I can make this work or are there any workarounds?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
尝试在Image控件外面放一个布局容器,比如Grid,设置为透明,然后在容器中处理drop事件
try put a layout container, such as Grid, outside the Image control, set it to be transparent, and then handle the drop event in the container