用户控件阻止底层用户控件接收拖放内容

发布于 2024-10-14 08:37:49 字数 319 浏览 2 评论 0原文

我有一个 WPF 应用程序,左侧有一个工具箱,其中包含可以在右侧大范围拖放的对象。这个大区域被视为一条时间线。顶部有一个滑块,用于滑动时间线,底部有一个标尺,显示时间增量。中间是接收拖放内容的区域。滑块(顶部)和标尺(底部)包含在滚动查看器中,在它们自己单独的用户控件中,该控件位于拖放区域的“顶部”。问题在于该用户控件阻碍了拖放区域接收其内容。我尝试在各种元素上尝试“IsHitTestVisible”属性,但这没有帮助。当我在适当的元素上禁用 IsHitTestVisible 属性时,它允许我正在寻找的拖放功能,但随后又禁用了我的滑块和滚动查看器。关于如何绕过这个问题有什么想法吗?提前致谢!

-马特

I have an WPF application where there is a toolbox on the left with objects that you can drag and drop in a large area to the right. This large area is treated like a time line. There is a slider at the top that is used to scrub through the time line and there is a ruler across the bottom displaying time increments. In the middle, there is the area that receives the drag and drop content. The slider (top) and ruler (bottom) are contained in a scroll viewer, in their own separate user control, which sits "on top" of the drag and drop area. The problem is that the this user control is obstructing the drag and drop area from receiving its content. I tried experimenting with the "IsHitTestVisible" property on various elements and this did not help. When i disabled the IsHitTestVisible property on the proper elements, it allowed for the drag and drop ability that I was looking for, but then in turn disabled my slider and scroll viewer. Any ideas on how to bypass this problem? Thanks in advance!

-Matt

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

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

发布评论

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

评论(1

神仙妹妹 2024-10-21 08:37:49

绕过...只需在“阻塞”控件上创建一个拖放事件并将该事件路由到您的函数即可。

A bypass... Just create a Drag and drop event on the "blocking" controls and route the event to your function.

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