Skip to content

New DataTransfer API does not allow passing of object references #20097

@pixsperdavid

Description

@pixsperdavid

Describe the bug

The updated DataTransfer (replacing DataObject) makes it impossible to pass arbitrary object references. This is very much required for internal Drag and Drop.

To Reproduce

The current DataFormat constructor is protected, and the currently available factory methods only allow formats of either string, byte[], IStorageItem or Bitmap types. This makes it impossible to create a custom DataFormat for an arbitrary class or struct type.

Expected behavior

Either the DataFormat constructor should be unprotected, or a new generic factory method should be created.

Avalonia version

11.3.9

OS

No response

Additional context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions