UIElement.TryStartDirectManipulation(Pointer) Method

Definition

Resumes direct manipulation processing (system-defined panning/zooming) on any ScrollViewer parent that contains the current UIElement.

public:
 static bool TryStartDirectManipulation(Pointer ^ value);
 static bool TryStartDirectManipulation(Pointer const& value);
public static bool TryStartDirectManipulation(Pointer value);
function tryStartDirectManipulation(value)
Public Shared Function TryStartDirectManipulation (value As Pointer) As Boolean

Parameters

value
Pointer

The active touch point that initiated the manipulation.

Returns

Boolean

bool

true if a ScrollViewer parent exists and setting the value resulted in resuming the panning/zooming action. false if calling the method results in no action.

Remarks

By default, touch input interactions in ScrollViewer elements are handled by the Direct Manipulation engine off the UI thread. An app cannot directly process the associated pointer events after Direct Manipulation processing starts. You can call CancelDirectManipulations at the start of a ScrollViewer interaction and handle the pointer events on the UI thread, which gives you the opportunity to do custom input handling in a ScrollViewer.

If you cancel Direct Manipulation processing at the start of a ScrollViewer interaction, you can call TryStartDirectManipulation to resume having Direct Manipulation process the input stream. This lets you do custom input processing first, and then resume Direct Manipulation handling to make your app more responsive to touch interactions like scrolling and zooming.

Only active touch contacts can be passed to Direct Manipulation. Using non-active or non-touch contacts causes an exception to be thrown.

Specifying a touch contact to pass to Direct Manipulation results in the framework walking up the parent chain and setting the contact on the Direct Manipulation viewport of each ScrollViewer encountered in order, until the walk reaches any element (including the original target element) that does not have a ManipulationMode that contains ManipulationModes.System. A given touch contact can only be associated with a single chain of visuals at a time. Calling TryStartDirectManipulation more than once on the same contact results in any previous chain being released.

Applies to

See also