问题:Silverlight 的最佳跨平台多点触控方法是什么?
背景:
我一直在开发大型 SL4 应用程序,现在开始将它们移植到 WP7。
移植本身非常棒——平台之间几乎不需要进行任何更改。但现在 WP7 带来了多点触控的问题。随着越来越困惑,我发现现在至少有 4 种不同的选项可以在 Silverlight 中实现多点触控,但没有一个是理想的,也没有一个是完美跨平台的。
我发现的对 Microsoft 提供的选项的最佳分析来自 Jeff Prosise(部分1,2, 3 和 4) 和 查尔斯·佩措尔德。
伟大的! Silverlight工具包中的GestureService/GestureListener看起来很完美。正是我所需要的。因此,我开始将其合并到我的应用程序中,并遇到了以下令人沮丧的序列。
-
GestureService/GestureListener 是
仅在 WP7 Silverlight 工具包中,
但不在 Silverlight 工具包中
对于 SL4。
-
好的。下载源代码
WP7 工具包并尝试使我的
自己的版本
SL4 的 GestureService/GestureListener。尽管 Touch.FrameReported
在 SL4 中可用,另一个关键类 Microsoft.Xna.Framework.Input.Touch 不可用。死胡同。
-
开始寻找开源替代触摸库。浪费很多时间。
-
确定
www.codeplex.com/multitouch。
在浪费了更多时间后发现
目前只有肖像模式
支持,但不支持横向。死的
结束。
那么,是否有任何解决方法可以让 GestureService/GestureListener 在 SL4 中工作?如果没有,有人能猜一下它何时/是否会在 SL4 工具包中可用吗?等待 SL5 并不是一个真正的选择。
Question: What is the best cross platform multitouch approach for Silverlight?
Background:
I’ve been developing large SL4 applications and have now started porting them to WP7.
The porting itself has been fantastic – virtually no changes required between the platforms. But now with WP7 comes the issue of multi-touch. With growing bemusement, I discovered that there are now at least 4 different options for implementing multi-touch in Silverlight, none ideal, and none perfectly cross platform.
The best analysis of the Microsoft provided options I’ve found are from Jeff Prosise (parts 1, 2, 3, and 4) and Charles Petzold.
Great! GestureService/GestureListener in the Silverlight Toolkit looks perfect. Just what I need. So I start down the path of incorporating this in my app and run into the following frustrating sequence.
-
GestureService/GestureListener is
only in the WP7 Silverlight Toolkit,
but not in the Silverlight Toolkit
for SL4.
-
OK. Download the source for the
WP7 Toolkit and attempt to make my
own version of
GestureService/GestureListener for SL4. Even though Touch.FrameReported
is available in SL4, another key class Microsoft.Xna.Framework.Input.Touch is not available. Dead End.
-
Start looking for open source alternative touch libraries. Waste many hours.
-
Settle on
www.codeplex.com/multitouch.
Discover after many more wasted hours
that only Portrait mode is currently
supported, and not Landscape. Dead
End.
So, is there any workaround to get GestureService/GestureListener working in SL4? If not, can anyone guess when/if it will be available in the SL4 toolkit? Waiting for SL5 isn't really an option.
发布评论
评论(2)
没有现成的解决方案。不过,我们已经构建了开源触摸库,以在 Silverlight 端缺失的事件中提供奇偶校验和连线。看一下:
http://lighttouch.codeplex.com/
There is no out of the box solution. However, we have built and open source touch library to provide parity and wire in the missing events on the Silverlight side. Take a look:
http://lighttouch.codeplex.com/
一年前我也遇到过同样的问题。不幸的是,我必须为 SL 实现自己的解决方案,该解决方案基于 Touch.FrameReported 和 TouchFrameEventArgs.GetTouchPoints。我知道,这有点低级,但对我来说这是唯一可靠的选择。
以下是 Tim Heuer 的简短教程: http://timheuer.com/blog/archive/2009/07/30/silverlight-3-multi-touch-introduction-fundamentals-basics.aspx
I had the same issue a year ago. Unfortunately, I had to implement my own solution for SL which was based on Touch.FrameReported and TouchFrameEventArgs.GetTouchPoints. I know, it is a little bit low-level, but it was the only reliable option for me.
Here is a short tutorial by Tim Heuer: http://timheuer.com/blog/archive/2009/07/30/silverlight-3-multi-touch-introduction-fundamentals-basics.aspx