开发者

MS Surface Tag Visualizer steals contact events

I'm struggling with the TagVisualizer control on an MS Surface project. In theory t开发者_如何学JAVAhe 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    

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?

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?

By the way, the layers all work fine, since they will only steal events that are directly on top of their sub elements (the rest of the layer is invisible to hit testing)


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>
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜