TouchEventArgs.TouchDevice Proprietà

Definizione

Ottiene il tocco che ha generato l'evento.Gets the touch that generated the event.

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

Valore della proprietà

Tocco che ha generato l'evento.The touch that generated the event.

Esempi

Nell'esempio seguente vengono gestiti TouchUp gli eventi che si verificano in un oggetto. CanvasThe following example handles the TouchUp events that occur on a Canvas. Controlla la Captured proprietà per verificare che il dispositivo che ha generato l'evento venga acquisito Canvasin.It checks the Captured property to verify that the device that raised the event is captured to the Canvas. In caso contrario, TouchDevice viene rilasciato.If it is, the TouchDevice is released.

Questo esempio fa parte di un esempio più ampio disponibile nella TouchDevice Panoramica della classe.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)
    {
        _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

Si applica a