Skip to main content

IAsyncDataTransferItem Interface

Definition

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

Represent an item inside a Avalonia.Input.IAsyncDataTransfer. An item may support several formats and can return the value of a given format on demand.

public interface IAsyncDataTransferItem

See also

Methods

NameDescription
TryGetRawAsyncTries to get a value for a given format.

TryGetRawAsync Method

Tries to get a value for a given format.

public System.Threading.Tasks.Task<object> TryGetRawAsync(Avalonia.Input.DataFormat format)

Parameters

format Avalonia.Input.DataFormat

The format to retrieve.

Returns

System.Threading.Tasks.Task<object>

A value for format, or null if the format is not supported.

Remarks

Implementations of this method are expected to return a value matching the exact type of the generic argument of the underlying Avalonia.Input.DataFormat<T>.

To retrieve a typed value, use Avalonia.Input.AsyncDataTransferItemExtensions.TryGetValueAsync<T>(Avalonia.Input.IAsyncDataTransferItem,Avalonia.Input.DataFormat{<>}).

See also

Properties

NameDescription
FormatsGets the formats supported by this item.

Formats Property

Gets the formats supported by this item.

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