DragData Class
The data of a drag from outside the user agent (e.g. files dragged from the file manager of the operating system): the files and the directories, and the strings (e.g. the text dragged from another application). Start the drag with PointerInput.BeginDrag or drop it at once with UserInput.Drop.
public sealed class DragDataConstructors
| Name | Description |
|---|---|
| DragData() |
DragData()
DragData.cspublic DragData()No documentation is available.
Properties
| Name | Description |
|---|---|
| EffectAllowed | Gets or sets the operations that the source of the drag allows: the effectAllowed of the DataTransfer objects (none, copy, copyLink, copyMove, link, linkMove, move or all, the default). |
| Entries | Gets the files and the directories that are dragged, in the order they were added. |
| Strings | Gets the strings that are dragged (their type, e.g. text/plain, and their data), in the order they were added. |
EffectAllowed
DragData.csEntries
DragData.csGets the files and the directories that are dragged, in the order they were added.
public IReadOnlyList<DragDataEntry> Entries { get; }Property value
Strings
DragData.csGets the strings that are dragged (their type, e.g. text/plain, and their data), in the order they were added.
public IReadOnlyList<KeyValuePair<string, string>> Strings { get; }Property value
Methods
| Name | Description |
|---|---|
| AddDirectory(string) | Adds an empty directory: add its files with DragDataDirectory.AddFile and DragDataDirectory.AddDirectory. |
| AddFile(string, ReadOnlyMemory<byte>, string?, DateTimeOffset?) | Adds a file. |
| AddFromDisk(string) | Adds a file or a directory of the disk, with its files and its subdirectories. The content is read when this method is called (a snapshot). The symbolic links to directories are not followed. |
| SetString(string, string) | Sets the string of a type (e.g. text/plain, text/uri-list or text/html): it replaces the string of the same type. |
AddDirectory(string)
DragData.csAdds an empty directory: add its files with DragDataDirectory.AddFile and DragDataDirectory.AddDirectory.
public DragDataDirectory AddDirectory(string name)AddFile(string, ReadOnlyMemory<byte>, string?, DateTimeOffset?)
DragData.csAdds a file.
public DragDataFile AddFile(string name, ReadOnlyMemory<byte> content, string? type = null, DateTimeOffset? lastModified = null)Parameters
namestring- The name of the file (it cannot contain
/or\, and cannot be.or..). contentReadOnlyMemory<byte>- The bytes of the file (not copied).
typestring?- The media type of the file, or null for the type of its extension (an empty type for an unknown extension).
lastModifiedDateTimeOffset?- The last modification date of the file, or null for the current time of the browsing context.
Returns
AddFromDisk(string)
DragData.csAdds a file or a directory of the disk, with its files and its subdirectories. The content is read when this method is called (a snapshot). The symbolic links to directories are not followed.
public DragDataEntry AddFromDisk(string path)Parameters
pathstring- The path of the file or of the directory.
Returns
Exceptions
FileNotFoundException- There is no file or directory at
path.