IAsyncDataTransfer Interface
Definition
Represents an object providing a list of Avalonia.Input.IAsyncDataTransferItem usable by the clipboard.
public interface IAsyncDataTransfer
Remarks
- When an implementation of this interface is put into the clipboard using Avalonia.Input.Platform.IClipboard.SetDataAsync(Avalonia.Input.IAsyncDataTransfer), it must NOT be disposed by the caller. The system will dispose of it automatically when it becomes unused.
- When an implementation of this interface is returned from the clipboard via Avalonia.Input.Platform.IClipboard.TryGetDataAsync, it MUST be disposed the caller.
- This interface is mostly used during clipboard operations. However, several platforms only support synchronous clipboard manipulation and will try to use Avalonia.Input.IDataTransfer if the underlying type also implements it. For this reason, custom implementations should ideally implement both Avalonia.Input.IAsyncDataTransfer and Avalonia.Input.IDataTransfer.
See also
Properties
| Name | Description |
|---|---|
| Formats | Gets the formats supported by a Avalonia.Input.IAsyncDataTransfer. |
| Items | Gets a list of Avalonia.Input.IAsyncDataTransferItem contained in this object. |
Formats Property
Gets the formats supported by a Avalonia.Input.IAsyncDataTransfer.
public System.Collections.Generic.IReadOnlyList<Avalonia.Input.DataFormat> Formats { get; set; }
Items Property
Gets a list of Avalonia.Input.IAsyncDataTransferItem contained in this object.
public System.Collections.Generic.IReadOnlyList<Avalonia.Input.IAsyncDataTransferItem> Items { get; set; }
Remarks
Some platforms (such as Windows and X11) may only support a single data item for all formats except Avalonia.Input.DataFormat.File.
Items returned by this property must stay valid until the Avalonia.Input.IAsyncDataTransfer is disposed.