关于IPv6你需要知道的10件事
2010-11-17 16:41
239 查看
目前Windows Phone 7的多点触摸屏可以支持4个指头同时触摸,甚至更多,但是这对于程序员来说就意味着需要更多的程序处理。下面就介绍一下在Silverlight中如何来处理低级别触摸屏事件以及Manipulation Event及Routed Event的作用。AD:element含义在Silverlight编程中element有两个含义,1.表示XML中的标签,2.表示界面中显示的对象,即UIElement,UIElement是非常重要的一个基类,所有的控件,如Grid, TextBlock, Button, Image等都集成于UIElement。Silverlight触屏Silverlight可分为低级别和高级别两个接口,其中,高级别接口通过UIElement类的三个事件处理实现的的:ManipulationStarted, ManipulationDelta, ManipulationCompleted;而低级别接口通过Touch.FrameReported实现的。其中Silverlight触屏接口最重要的一个类是TouchPoint,一个TouchPoint代表一个指头触摸屏幕。TouchPoint有4个只读属性:
![](http://images.51cto.com/files/uploadimg/20120202/1637430.jpg)
[align=center]TouchPoint的只读属性[/align]使用低级别触屏街口的话,需要在程序中注册事件处理函数:Touch.FrameReported += OnTouchFrameReported;一般我们可以把这行代码放到页面的构造函数中OnTouchFrameReported函数原型为:void OnTouchFrameReported(object sender, TouchFrameEventArgsargs){ }这个处理函数里面,可以通过TouchFrameEventArgs的以下三种方法获得我们想要相关的信息1.GetTouchPoints获得所有的触摸坐标,返回的是TouchPointCollection,多点触摸这可以通过这个判断2.GetPrimaryTouchPoint只返回一个TouchPoint3.SuspendMousePromotionUntilToucnUp,这个成员函数的具体含义大家查阅MSDN即可。
![](http://images.51cto.com/files/uploadimg/20120202/1637430.jpg)
[align=center]TouchPoint的只读属性[/align]使用低级别触屏街口的话,需要在程序中注册事件处理函数:Touch.FrameReported += OnTouchFrameReported;一般我们可以把这行代码放到页面的构造函数中OnTouchFrameReported函数原型为:void OnTouchFrameReported(object sender, TouchFrameEventArgsargs){ }这个处理函数里面,可以通过TouchFrameEventArgs的以下三种方法获得我们想要相关的信息1.GetTouchPoints获得所有的触摸坐标,返回的是TouchPointCollection,多点触摸这可以通过这个判断2.GetPrimaryTouchPoint只返回一个TouchPoint3.SuspendMousePromotionUntilToucnUp,这个成员函数的具体含义大家查阅MSDN即可。
相关文章推荐
- 关于IPv6你需要知道的10件事
- 关于IPv6你需要知道的10件事
- 关于IPv6你需要知道的10件事
- 关于IPv6你需要知道的10件事
- 关于CSS需要知道的10件事
- 关于 IPv6 你需要知道的 10 件事
- 关于 IPv6 你需要知道的 10 件事
- 转载你需要知道的关于NoSQL数据库的10件事
- 关于 IPv6 你需要知道的 10 件事
- 关于 IPv6 你需要知道的 10 件事
- 关于CSS需要知道的10件事
- 关于Tokens你需要知道的10件事
- 关于DevOps趋势你所需要知道的10件事
- IT者需要知道的关于Ajax的10件事[转]
- 关于 Cocoa Auto Layout,你需要知道10件事
- 你需要知道的关于NoSQL数据库的10件事
- 你需要知道的关于NoSQL数据库的10件事
- 你需要知道的关于NoSQL数据库的10件事
- 关于iOS APP 需要支持ipv6-only 开发者需要做的事情
- oracle 11g GRID 中 关于 OLR 需要知道的一些内容