MS Surface Tag Visualizer窃取联系事件 [英] MS Surface Tag Visualizer steals contact events

查看:90
本文介绍了MS Surface Tag Visualizer窃取联系事件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在为MS上的 TagVisualizer 控件苦苦挣扎表面项目.从理论上讲,控件似乎很棒,可以让您响应来自现实世界物理对象的输入

I'm struggling with the TagVisualizer control on an MS Surface project. In theory the control seems great, allowing you to respond to input from real world physical objects

问题在于该控件将覆盖整个屏幕(因为我想在整个屏幕上捕获标签),因此,我的应用程序中没有其他控件会接收到触摸事件. (除非它们是视觉树中的直接上升点.)

The problem is that the control will cover the entire screen (since I want to capture tags on the entire screen) and as such, no other controls in my app will receive the touch events. (Unless, they are direct ascendants in the visual tree).

在我的应用中,我想要一种层"类型的方法,其中每个层都可以响应(接触)输入:

In my app, I want to have a "layer" type of a approach, where each layer can respond to (contact) input:

Window
  `- Grid
      `- LayersPanel
          `- TagVisualizer
          `- Layer 1
          `- Layer 2
          `- Layer 3
          `- Layer 4    

现在,将标记可视化工具放在何处都无所谓,它总是会窃取所有或其他一些其他层的联系事件. (由于 RoutedEvents 的性质)

Now it doesn't matter where I put the tag visualizer, it's always going to steal contact events from all or some of the other layers. (due to the nature of RoutedEvents)

在我看来,该控件在实践中似乎完全没有用,因为它总是会干扰您应用程序的其他控件.我在这里想念什么?

To me, it seems like the control is completely useless in practice as it will always interfere with your application's other controls. What am I missing here?

我的问题是:关于如何解决此问题的任何建议?有没有人在类似的情况下使用过TagVisualizers?如果是这样,您如何解决这个问题?

So my questions are: Any suggestions on how to work around this? Has anyone used TagVisualizers in a similar scenario? If so, how did you solve this?

顺便说一句,这些层都可以正常工作,因为它们只会窃取直接位于其子元素之上的事件(该层的其余部分对于命中测试是不可见的)

推荐答案

使用TagVisualizer时,诀窍在于必须将整个应用程序放入其中.例如:

When using TagVisualizer, the trick is that you have to put your whole app inside of it. For example:

<s:TagVisualizer>
  <s:TagVisualizer.Definitions>
    <s:ByteTagVisualizationDefinition Value="00" />
  </s:TagVisualizer.Definitions>
  <s:ScatterView>
    <s:ScatterViewItem />
    <s:ScatterViewItem />
    <s:ScatterViewItem />
    <s:ScatterViewItem />
  </s:ScatterView>
</s:TagVisualizer>

这篇关于MS Surface Tag Visualizer窃取联系事件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆