Skip to main content

TryGetInProcessDataAsync Method

Retrieves the exact instance of a IAsyncDataTransfer previously placed on the clipboard by SetDataAsync(IAsyncDataTransfer), if any.

Definition

Namespace: Avalonia.Input.Platform
Assembly: Avalonia.Base (in Avalonia.Base.dll)

Task<IAsyncDataTransfer?> TryGetInProcessDataAsync()
View Source

Return Value

Task(IAsyncDataTransfer)
The data transfer object if present, null otherwise.

Remarks

This method cannot be used to retrieve a IAsyncDataTransfer set by another process.

This method is only supported on Windows, macOS and X11 platforms. Other platforms will always return null.

Contrary to TryGetDataAsync(), the returned IAsyncDataTransfer must NOT be disposed by the caller since it's still owned by the clipboard.

See Also

Reference

IClipboard Interface
Avalonia.Input.Platform Namespace