DataTransferItem Class
A mutable implementation of IDataTransferItem and IAsyncDataTransferItem. This class also provides several static methods to easily create a DataTransferItem for common usages.
Definition
Namespace: Avalonia.Input
Assembly: Avalonia.Base (in Avalonia.Base.dll)
- C#
- VB
- F#
public sealed class DataTransferItem : IDataTransferItem,
IAsyncDataTransferItem
Public NotInheritable Class DataTransferItem
Implements IDataTransferItem, IAsyncDataTransferItem
[<SealedAttribute>]
type DataTransferItem =
class
interface IDataTransferItem
interface IAsyncDataTransferItem
end
Inheritance | Object → DataTransferItem |
Implements | IAsyncDataTransferItem, IDataTransferItem |
Remarks
While it also implements IAsyncDataTransferItem, this class always returns data synchronously. For advanced usages, consider implementing IAsyncDataTransferItem directly.
Constructors
DataTransferItem() | Initializes a new instance of the DataTransferItem class |
Properties
Formats | Gets the formats supported by this item. |
Methods
Create(T)(DataFormat(T), T) | Creates a new DataTransferItem for a single format with a given value. |
Create(T)(DataFormat(T), Func(T)) | Creates a new DataTransferItem for a single format with a given value created on demand. |
CreateFile(IStorageItem) | Creates a new DataTransferItem with File as a single format. |
CreateText(String) | Creates a new DataTransferItem with Text as a single format. |
Equals(Object) | Determines whether the specified object is equal to the current object. (Inherited from Object) |
GetHashCode() | Serves as the default hash function. (Inherited from Object) |
GetType() | Gets the Type of the current instance. (Inherited from Object) |
Set(T)(DataFormat(T), T) | Sets the value for a given format. |
Set(T)(DataFormat(T), Func(T)) | Sets a value created on demand for a given format. |
SetFile(IStorageItem) | Sets the value for the File format. |
SetText(String) | Sets the value for the Text format. |
ToString() | Returns a string that represents the current object. (Inherited from Object) |
TryGetRaw(DataFormat) | Tries to get a value for a given format. |