Skip to main content

IDataTransfer Interface

Represents an object providing a list of IDataTransferItem usableduring a drag and drop operation.

Definition

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

public interface IDataTransfer : IDisposable
View Source
ImplementsIDisposable

Remarks

When an implementation of this interface is used as a drag source using DoDragDropAsync(PointerEventArgs, IDataTransfer, DragDropEffects), it must NOT be disposed by the caller. The system will dispose of it automatically when the drag operation completes.

Properties

FormatsGets the formats supported by a IDataTransfer.
ItemsGets a list of IDataTransferItem 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 IDataTransfer supports a specific format.
(Defined by DataTransferExtensions)
GetItems(DataFormat)Gets the list of IDataTransferItem contained in this object, filtered by a given format.
(Defined by DataTransferExtensions)
TryGetFile()Returns a file, if available, from a IDataTransfer instance.
(Defined by DataTransferExtensions)
TryGetFiles()Returns a list of files, if available, from a IDataTransfer instance.
(Defined by DataTransferExtensions)
TryGetText()Returns a text, if available, from a IDataTransfer instance.
(Defined by DataTransferExtensions)
TryGetValue(T)(DataFormat(T))Tries to get a value for a given format from a IDataTransfer.
(Defined by DataTransferExtensions)
TryGetValues(T)(DataFormat(T))Tries to get multiple values for a given format from a IDataTransfer.
(Defined by DataTransferExtensions)

See Also

Reference

Avalonia.Input Namespace
DataTransfer