UIElement.StartDragAsync 方法
定義
重要
部分資訊涉及發行前產品,在發行之前可能會有大幅修改。 Microsoft 對此處提供的資訊,不做任何明確或隱含的瑕疵擔保。
多載
StartDragAsync(ExpPointerPoint) | |
StartDragAsync(PointerPoint) |
起始拖放作業。 重要 如果使用者以系統管理員身分以提升許可權模式執行應用程式,則不支援。 |
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)
參數
- pointerPoint
- ExpPointerPoint
傳回
- 屬性
適用於
StartDragAsync(PointerPoint)
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)
參數
- pointerPoint
- PointerPoint
用戶與畫面互動的指標座標,以及拖曳視覺效果的附加位置。
傳回
Windows.ApplicationModel.DataTransfer.DataPackageOperation 值,指出拖放作業的類型,以及作業是否成功。
- 屬性
備註
如果您實作自定義手勢偵測來起始拖曳作業,您可以呼叫 Microsoft.UI.Xaml.UIElement.StartDragAsync 方法,以程序設計方式在任何 UIElement 上起始拖曳作業。 呼叫此方法會導致引發 Microsoft.UI.Xaml.UIElement.DragStarting 事件。 處理 DragStarting 事件以指定作業的其他屬性,例如數據封裝和拖曳視覺效果。
pointerPoint 參數是使用者使用輸入設備(觸控、滑鼠或手寫筆)與螢幕互動的點。 拖曳作業期間顯示的拖曳視覺效果會附加至呼叫端提供的指標,PointerPoint。
此方法傳回的 Microsoft.UI.Xaml.UIElement.StartDragAsync 會指出拖曳作業是否為移動、複製或連結;以及是否成功。 這個值與 Microsoft.UI.Xaml.DropCompletedEventArgs.DropResult 属性所提供的值相同。