Udostępnij za pośrednictwem


UIElement.StartDragAsync Method

Definition

Overloads

StartDragAsync(ExpPointerPoint)
StartDragAsync(PointerPoint)

Initiates a drag-and-drop operation.

Important

Not supported if a user runs the app in elevated mode, as an administrator.

StartDragAsync(ExpPointerPoint)

public:
 virtual IAsyncOperation<DataPackageOperation> ^ StartDragAsync(ExpPointerPoint ^ pointerPoint) = StartDragAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DataPackageOperation> StartDragAsync(ExpPointerPoint const& pointerPoint);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DataPackageOperation> StartDragAsync(ExpPointerPoint pointerPoint);
function startDragAsync(pointerPoint)
Public Function StartDragAsync (pointerPoint As ExpPointerPoint) As IAsyncOperation(Of DataPackageOperation)

Parameters

pointerPoint
ExpPointerPoint

Returns

Attributes

Applies to

StartDragAsync(PointerPoint)

Initiates a drag-and-drop operation.

Important

Not supported if a user runs the app in elevated mode, as an administrator.

public:
 virtual IAsyncOperation<DataPackageOperation> ^ StartDragAsync(PointerPoint ^ pointerPoint) = StartDragAsync;
/// [Windows.Foundation.Metadata.RemoteAsync]
IAsyncOperation<DataPackageOperation> StartDragAsync(PointerPoint const& pointerPoint);
[Windows.Foundation.Metadata.RemoteAsync]
public IAsyncOperation<DataPackageOperation> StartDragAsync(PointerPoint pointerPoint);
function startDragAsync(pointerPoint)
Public Function StartDragAsync (pointerPoint As PointerPoint) As IAsyncOperation(Of DataPackageOperation)

Parameters

pointerPoint
PointerPoint

The coordinates of the pointer where the user interacts with the screen, and where the drag visual is attached.

Returns

A Windows.ApplicationModel.DataTransfer.DataPackageOperation value that indicates the type of drag-and-drop operation, and whether the operation was successful.

Attributes

Remarks

If you implement custom gesture detection to initiate a drag operation, you can call the Microsoft.UI.Xaml.UIElement.StartDragAsync method to programmatically initiate a drag operation on any UIElement. Calling this method results in the Microsoft.UI.Xaml.UIElement.DragStarting event being raised. Handle the DragStarting event to specify other properties of the operation, such as the data package and drag visual.

The pointerPoint parameter is the point at which the user interacts with the screen using an input device (touch, mouse, or pen). The drag visual that is shown during the drag operation is attached to the pointer indicated in the caller-provided PointerPoint.

The Microsoft.UI.Xaml.UIElement.StartDragAsync returned by this method indicates whether the drag operation is a move, copy, or link; and whether or not it's a success. This is the same value that's provided by the Microsoft.UI.Xaml.DropCompletedEventArgs.DropResult property.

Applies to