TouchDevice.Captured 屬性
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
取得擷取到 TouchDevice 的項目。
public:
property System::Windows::IInputElement ^ Captured { System::Windows::IInputElement ^ get(); };
public System.Windows.IInputElement Captured { get; }
member this.Captured : System.Windows.IInputElement
Public ReadOnly Property Captured As IInputElement
屬性值
擷取到 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