Assembly: System.Windows (in System.Windows.dll)
Return ValueType: System.Windows.Point
A Point that represents the current x- and y-coordinates of the pointer position. If null was passed as relativeTo, this coordinate is for the overall Windows Phone content area. If a non-null relativeTo was passed, this coordinate is relative to the object referenced by relativeTo.
The most common usage is to pass relativeTo as null, which returns a coordinate position of the pointer within the overall Windows Phone content area.
The relativeTo parameter can also be set to any UIElement-derived object that is contained by the Windows Phone. The returned pointer position is relative to the object referenced as relativeTo. Depending on the location of relativeTo relative to the object, the coordinate values of the pointer position may be negative values.
If you are handling the event from the root element of the visual tree and FlowDirection equals LeftToRight, passing the root element as relativeTo or passing null are equivalent.
The UIElement that is passed as relativeTo must be connected to the current object hierarchy, in such a way that successive resolution of parents is connected to the root element. Passing a UIElement that is disconnected will generate an error.
Because some pointer events bubble, the sender parameter of the event handler that also received the event data may or may not be suitable for use as a frame of reference for the relativeTo parameter of . Make sure that your handler for an event that attempts to use sender for a call is being handled by the expected object, and has not bubbled upwards, perhaps being handled by the root element if you also have a handler there.
The position returned by is not the position of the client user's overall screen, or even of the hosting browser, it is purely a coordinate space used by Windows Phone in its content area. Depending on what information a given browser exposes to its DOM, it is often possible to obtain a browser positional offset for the Windows Phone content area from the HTML DOM, and add that offset to the X and Y values from the Windows Phone pointer position to get a browser-relative coordinate. This might be useful if you are working with HTML overlays.