MS Surface Tag Visualizer 窃取接触事件

发布于 2024-08-31 01:20:26 字数 878 浏览 1 评论 0原文

我正在努力处理 MS Surface 项目上的 TagVisualizer 控件。理论上,该控件看起来很棒,允许您响应来自现实世界物理对象的输入。

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

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

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

现在,无论我将标签可视化工具放在哪里,它总是会窃取所有接触事件或其他一些层。 (由于 RoatedEvents 的性质)

对我来说,似乎该控件在实践中完全无用,因为它总是会干扰应用程序的其他控件。我在这里缺少什么?

所以我的问题是:关于如何解决这个问题有什么建议吗?有人在类似场景中使用过 TagVisualizers 吗?如果是这样,你是如何解决这个问题的?

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

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    

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)

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

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

发布评论

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

评论(1

_畞蕅 2024-09-07 01:20:26

使用 TagVisualizer 时,诀窍是您必须将整个应用程序放入其中。例如:

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

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