在 InkCanvas 上显示笔划,但不捕获事件
我正在开发一个触摸屏应用程序,并允许用户使用墨水画布将基于触摸的标记添加到覆盖内容上。我已经达到了这样的程度:覆盖层后面的视图有一个需要允许用户与之交互的元素,但事件是由 InkCanvas 捕获的,而不是由底层控件捕获的。有没有办法显示笔画,但仍然允许 InkCanvas 后面的控件捕获事件?
I am developing a touch screen application and allow users to add touch-based markup to an overlay over content using an ink canvas. I have reached a point where the view behind the overlay has an element that needs the user should be allowed to interact with, but events are captured by the InkCanvas and not by the underlying control. Is there a way to display strokes, but still allow controls behind the InkCanvas to capture events?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
您可以设置 InkCanvas.IsHitTestVisible = false,它仍然会显示,但您将无法与它交互,并且所有事件都将转到 z 顺序较低的元素,这听起来正是您想要的想。
You can set
InkCanvas.IsHitTestVisible = false
and it will still display but you will not be able to interact with it and all events will go to elements lower in the z-order, which sounds like exactly what you want.就我而言,我正在切换 InkCanvas。为了实现此目的,我还必须设置
InkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.None
来禁用它。In my case I'm toggling the InkCanvas. To accomplish this, I also had to set
InkCanvas.InkPresenter.InputDeviceTypes = CoreInputDeviceTypes.None
to disable it.