Position Property
Collapse the table of content
Expand the table of content

TouchPoint.Position Property

[ This article is for Windows Phone 8 developers. If you’re developing for Windows 10, see the latest documentation. ]

Gets the X,Y coordinate position of the touch point as a Point.

Namespace:  System.Windows.Input
Assembly:  System.Windows (in System.Windows.dll)

public Point Position { get; }

Property Value

Type: System.Windows.Point
A Point value that reports the coordinate position of the touch point.

The Position property reports the exact center of the contact area for a touch point. To get a bounding box for a particular TouchPoint, you can center a bounding box on the Position point and then base the dimensions of that bounding box on the Size property.

If you want to calculate an offset from a particular UI element, you can pass that element as the input for either GetPrimaryTouchPoint or GetTouchPoints as part of your touch input-event handling that generates the TouchPoint. Using the UI element input results in a TouchPoint that has relative coordinates for its Position and the coordinates are already calculated relative to the offset. Otherwise, to use the general coordinate reference of the overall Windows Phone content area, pass null for the input of GetPrimaryTouchPoint or GetTouchPoints.

Windows Phone OS

Supported in: 8.1, 8.0, 7.1, 7.0

Windows Phone

Show:
© 2017 Microsoft