TouchEventArgs TouchEventArgs TouchEventArgs TouchEventArgs Class


提供觸控輸入事件的資料。Provides data for touch input events.

public ref class TouchEventArgs : System::Windows::Input::InputEventArgs
public class TouchEventArgs : System.Windows.Input.InputEventArgs
type TouchEventArgs = class
    inherit InputEventArgs
Public Class TouchEventArgs
Inherits InputEventArgs


下列範例會處理TouchUp Canvas在上發生的事件。The following example handles the TouchUp events that occur on a Canvas. 它會檢查Captured屬性, 以確認引發事件的裝置已捕捉Canvas至。It checks the Captured property to verify that the device that raised the event is captured to the Canvas. 如果為, TouchDevice則會釋放。If it is, the TouchDevice is released.

這個範例是TouchDevice類別總覽中提供之較大範例的一部分。This example is part of a larger example that is available in the TouchDevice class overview.

private void canvas_TouchUp(object sender, TouchEventArgs e)
    Canvas _canvas = (Canvas)sender as Canvas;
    if (_canvas != null && e.TouchDevice.Captured == _canvas)
' Touch Up
Private Sub canvas_TouchUp(ByVal sender As System.Object, ByVal e As System.Windows.Input.TouchEventArgs)
    Dim _canvas As Canvas = CType(sender, Canvas)
    If (_canvas IsNot Nothing AndAlso e.TouchDevice.Captured Is _canvas) Then

    End If
End Sub


下列事件會使用TouchEventArgsThe following events use TouchEventArgs.


TouchEventArgs(TouchDevice, Int32) TouchEventArgs(TouchDevice, Int32) TouchEventArgs(TouchDevice, Int32) TouchEventArgs(TouchDevice, Int32)

初始化 TouchEventArgs 類別的新執行個體。Initializes a new instance of the TouchEventArgs class.


Device Device Device Device

取得初始化這個事件的輸入裝置。Gets the input device that initiated this event.

(Inherited from InputEventArgs)
Handled Handled Handled Handled

取得或設定值,這個值表示路由事件在傳送路由時之事件處理的目前狀態。Gets or sets a value that indicates the present state of the event handling for a routed event as it travels the route.

(Inherited from RoutedEventArgs)
OriginalSource OriginalSource OriginalSource OriginalSource

在父類別進行任何可能的 Source 調整之前,取得純點擊測試所判定的原始報告來源。Gets the original reporting source as determined by pure hit testing, before any possible Source adjustment by a parent class.

(Inherited from RoutedEventArgs)
RoutedEvent RoutedEvent RoutedEvent RoutedEvent

取得或設定與這個 RoutedEventArgs 執行個體相關聯的 RoutedEventGets or sets the RoutedEvent associated with this RoutedEventArgs instance.

(Inherited from RoutedEventArgs)
Source Source Source Source

取得或設定引發事件之物件的參考。Gets or sets a reference to the object that raised the event.

(Inherited from RoutedEventArgs)
Timestamp Timestamp Timestamp Timestamp

取得這個事件發生的時間。Gets the time when this event occurred.

(Inherited from InputEventArgs)
TouchDevice TouchDevice TouchDevice TouchDevice

取得產生事件的觸控。Gets the touch that generated the event.


Equals(Object) Equals(Object) Equals(Object) Equals(Object)

判斷指定的物件是否等於目前的物件。Determines whether the specified object is equal to the current object.

(Inherited from Object)
GetHashCode() GetHashCode() GetHashCode() GetHashCode()

做為預設雜湊函式。Serves as the default hash function.

(Inherited from Object)
GetIntermediateTouchPoints(IInputElement) GetIntermediateTouchPoints(IInputElement) GetIntermediateTouchPoints(IInputElement) GetIntermediateTouchPoints(IInputElement)

傳回最後兩次觸控事件期間收集到的所有觸控點。Returns all touch points that were collected between the most recent and previous touch events.

GetTouchPoint(IInputElement) GetTouchPoint(IInputElement) GetTouchPoint(IInputElement) GetTouchPoint(IInputElement)

傳回目前觸控裝置相對於指定之項目的位置。Returns the current position of the touch device relative to the specified element.

GetType() GetType() GetType() GetType()

取得目前執行個體的 TypeGets the Type of the current instance.

(Inherited from Object)
InvokeEventHandler(Delegate, Object) InvokeEventHandler(Delegate, Object) InvokeEventHandler(Delegate, Object) InvokeEventHandler(Delegate, Object)

以型別專屬的方式叫用事件處理常式,這樣做能夠提升事件系統的效率。Invokes event handlers in a type-specific way, which can increase event system efficiency.

MemberwiseClone() MemberwiseClone() MemberwiseClone() MemberwiseClone()

建立目前 Object 的淺層複本 (Shallow Copy)。Creates a shallow copy of the current Object.

(Inherited from Object)
OnSetSource(Object) OnSetSource(Object) OnSetSource(Object) OnSetSource(Object)

在衍生類別中覆寫時,每當執行個體的 Source 屬性值變更,便會提供通知回呼進入點。When overridden in a derived class, provides a notification callback entry point whenever the value of the Source property of an instance changes.

(Inherited from RoutedEventArgs)
ToString() ToString() ToString() ToString()

傳回代表目前物件的字串。Returns a string that represents the current object.

(Inherited from Object)