用户控件阻止底层用户控件接收拖放内容
我有一个 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 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
绕过...只需在“阻塞”控件上创建一个拖放事件并将该事件路由到您的函数即可。
A bypass... Just create a Drag and drop event on the "blocking" controls and route the event to your function.