IDesktopDragSourceWindowHost interface

Namespace Runic.Desktop in Runic.Desktop 0.23.0

public interface IDesktopDragSourceWindowHost : IDesktopWindowHost, IAsyncDisposable

Inherits or implements IDesktopWindowHost, IAsyncDisposable.

An optional native host that starts drags out of its window.

Remarks

Report DesktopWindowCapabilities.FileDrag in IDesktopWindowHost.Capabilities. Runic Desktop finds the interface by type and calls IDesktopDragSourceWindowHost.StartDragAsync for DesktopWindow.StartDragAsync with checked data.

Methods

StartDragAsync

ValueTask<DesktopDragEffects> StartDragAsync(DesktopDragData data, CancellationToken cancellationToken = default)

Starts the platform's drag and drop with data and completes with the drop's effect.

Parameters

data

The data, already checked against the rules of DesktopDragData.

cancellationToken

Cancels before the drag starts.

Returns

The effect the target chose, one of DesktopDragData.AllowedEffects, or DesktopDragEffects.None when the drag was cancelled, dropped nowhere, or no mouse button was held.

Remarks

Start the drag on the window's UI thread from the pointer's current position, offering the paths as the platform's file list, the text as plain text and the URIs as links, and complete once the drag has ended.