天天看點

使用C#開發Metro 風格應用的路線圖 -- 觸屏操作

win8支援多點觸摸技術,而我們在螢幕上所做的各種操作,也最終轉換為輸入,包括

操作

描述

Tap

一個指頭輕點一下螢幕

Hold

一個指頭按住螢幕不動

Drag

一個或多個指頭按住螢幕并相相同的方向移動

Pinch

兩個指頭按住螢幕越來越近或越來越遠

Rotate

兩個批判按住螢幕做順時或逆時針旋轉

Cross-slide

一個指頭按住一個對象向某個方向滑動.

在window runtime上響應觸屏事件的方法分為兩類:單點和多點。下面分别介紹:

單點事件包括:

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.pointerpressed">PointerPressed</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.pointerreleased">PointerReleased</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.pointermoved">PointerMoved</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.pointerentered">PointerEntered</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.pointerexited">PointerExited</a>

多點事件包括:

Class

Description

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.manipulationstarted">ManipulationStarted Event</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.manipulationdelta">ManipulationDelta Event</a>

Occurs when the input device changes position during a manipulation.

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.uielement.manipulationcompleted">ManipulationCompleted Event</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.input.manipulationstartedeventargs">ManipulationStartedEventArgs</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.input.manipulationdeltaeventargs">ManipulationDeltaEventArgs</a>

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.input.manipulationvelocities">ManipulationVelocities</a>

Describes the speed at which manipulations occur.

<a href="http://msdn.microsoft.com/zh-cn/library/windows/apps/xaml/windows.ui.xaml.input.manipulationcompletedeventargs">ManipulationCompletedEventArgs</a>

注:在模拟器可以用滑鼠滾輪模拟

在UI上的設計要點

顯示标明使用者正在操作的對象

當平衡時帶點加速和慣性效果

使用捕捉點及其他方面的限制來幫助使用者擷取有用的對象