Skip to main content

IAsyncDataTransfer Interface

Represents an object providing a list of IAsyncDataTransferItem usable by the clipboard.

Definition

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

public interface IAsyncDataTransfer : IDisposable
View Source
ImplementsIDisposable

Remarks

  • When an implementation of this interface is put into the clipboard using SetDataAsync(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 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 IDataTransfer if the underlying type also implements it. For this reason, custom implementations should ideally implement both IAsyncDataTransfer and IDataTransfer.

Properties

FormatsGets the formats supported by a IAsyncDataTransfer.
ItemsGets a list of IAsyncDataTransferItem contained in this object.

Methods

Dispose()Performs application-defined tasks associated with freeing, releasing, or resetting unmanaged resources.
(Inherited from IDisposable)

Extension Methods

Contains(DataFormat)Gets whether a IAsyncDataTransfer supports a specific format.
(Defined by AsyncDataTransferExtensions)
GetItems(DataFormat)Gets the list of IAsyncDataTransferItem contained in this object, filtered by a given format.
(Defined by AsyncDataTransferExtensions)
TryGetFileAsync()Returns a file, if available, from a IAsyncDataTransfer instance.
(Defined by AsyncDataTransferExtensions)
TryGetFilesAsync()Returns a list of files, if available, from a IAsyncDataTransfer instance.
(Defined by AsyncDataTransferExtensions)
TryGetTextAsync()Returns a text, if available, from a IAsyncDataTransfer instance.
(Defined by AsyncDataTransferExtensions)
TryGetValueAsync(T)(DataFormat(T))Tries to get a value for a given format from a IAsyncDataTransfer.
(Defined by AsyncDataTransferExtensions)
TryGetValuesAsync(T)(DataFormat(T))Tries to get multiple values for a given format from a IAsyncDataTransfer.
(Defined by AsyncDataTransferExtensions)

See Also

Reference

Avalonia.Input Namespace
DataTransfer