使用C#开发Metro 风格应用的路线图 -- 触屏操作

来源:互联网 发布:第一个人工智能机器人 编辑:程序博客网 时间:2024/06/06 00:39

win8支持多点触摸技术,而我们在屏幕上所做的各种操作,也最终转换为输入,包括

操作描述Tap一个指头轻点一下屏幕Hold一个指头按住屏幕不动Drag一个或多个指头按住屏幕并相相同的方向移动Pinch两个指头按住屏幕越来越近或越来越远Rotate两个批判按住屏幕做顺时或逆时针旋转Cross-slide一个指头按住一个对象向某个方向滑动.

 
在window runtime上响应触屏事件的方法分为两类:单点和多点。下面分别介绍:

单点事件包括:

PointerPressed
PointerReleased
PointerMoved
PointerEntered
PointerExited

这些事件的参数都是PointerEventArgs.

多点事件包括:

ClassDescriptionManipulationStarted EventOccurs when an input device begins a manipulation on the UIElement.ManipulationDelta EventOccurs when the input device changes position during a manipulation.ManipulationCompleted EventOccurs when a manipulation and inertia on the UIElement are complete.ManipulationStartedEventArgsProvides data for the ManipulationStarted event.ManipulationDeltaEventArgsProvides data for the ManipulationDelta event.ManipulationVelocitiesDescribes the speed at which manipulations occur.ManipulationCompletedEventArgsProvides data for the ManipulationCompleted event.

当多点操作时,一般先触发 ManipulationStarted 事件,然后是一连串的ManipulationDelta事件触发,最后是ManipulationCompleted事件.
注:在模拟器可以用鼠标滚轮模拟

在UI上的设计要点

  • 显示标明用户正在操作的对象
  • 当平衡时带点加速和惯性效果
  • 使用捕捉点及其他方面的限制来帮助用户获取有用的对象