Skip to main content

SetDataAsync Method

Places a data object on the clipboard. The data object is responsible for providing supported formats and data upon request.

Definition

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

Task SetDataAsync(
IAsyncDataTransfer? dataTransfer
)
View Source

Parameters

  IAsyncDataTransfer
The data object to set on the clipboard.

Return Value

Task

Remarks

If dataTransfer is null, nothing will get placed on the clipboard and this method will be equivalent to ClearAsync().

The IAsyncDataTransfer must NOT be disposed by the caller after this call. The clipboard will dispose of it automatically when it becomes unused.

See Also

Reference

IClipboard Interface
Avalonia.Input.Platform Namespace