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 的浅表副本。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)