TouchEventArgs.TouchDevice 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得產生事件的觸控。
public:
property System::Windows::Input::TouchDevice ^ TouchDevice { System::Windows::Input::TouchDevice ^ get(); };
public System.Windows.Input.TouchDevice TouchDevice { get; }
member this.TouchDevice : System.Windows.Input.TouchDevice
Public ReadOnly Property TouchDevice As TouchDevice
屬性值
產生事件的觸控。
範例
下列範例會處理 TouchUp 上 Canvas發生的事件。 它會檢查 Captured 屬性,以確認引發事件的裝置已擷取至 Canvas。 如果是,則會 TouchDevice 釋出 。
這個範例是類別概觀中可用的較大範例的 TouchDevice 一部分。
private void canvas_TouchUp(object sender, TouchEventArgs e)
{
Canvas _canvas = (Canvas)sender as Canvas;
if (_canvas != null && e.TouchDevice.Captured == _canvas)
{
_canvas.ReleaseTouchCapture(e.TouchDevice);
}
}
' 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
_canvas.ReleaseTouchCapture(e.TouchDevice)
End If
End Sub