Skip to main content

IDataTransfer Interface

Definition​

Namespace:Avalonia.Input
Assembly:Avalonia.Base
Package:Avalonia

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

public interface IDataTransfer

Implements: IDisposable

Remarks​

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

See also​

Properties​

NameDescription
FormatsGets the formats supported by a Avalonia.Input.IDataTransfer.
ItemsGets a list of Avalonia.Input.IDataTransferItem contained in this object.

Formats Property​

Gets the formats supported by a Avalonia.Input.IDataTransfer.

public System.Collections.Generic.IReadOnlyList<Avalonia.Input.DataFormat> Formats { get; set; }

Items Property​

Gets a list of Avalonia.Input.IDataTransferItem contained in this object.

public System.Collections.Generic.IReadOnlyList<Avalonia.Input.IDataTransferItem> 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.IDataTransfer is disposed.