Vixen
dd8b0a81

DragOverEvent

class Core/Vixen.Ui/Drop.cs:178
csharp
public sealed class DragOverEvent

A drag passing over a drop target, before anything has been let go.

Read the guide page for this →

Remarks

This is the half an OS drag-in cannot have and an in-app drag is mostly made of. The useful part of a drag is not the drop, it is the feedback on the way — a row that opens a gap where the thing would land, a slot that lights up, a cursor that says copy rather than move. All of that needs the payload before the button comes up, which is what Data here is for.

⚠ Addressed to one element and it is not the hit-test result. It goes to the nearest ancestor of what is under the pointer that has AllowDrop set, because Entered and Left have to be a matched pair — raised on every leaf the pointer crossed they would arrive dozens of times while the pointer travelled across one row of text, and a target that opened a gap on enter would flicker it. It bubbles from there like everything else.

Fields and properties (7)

  • public DragOverStage Stage

    Coming on, moving over, or going away.

  • public float X

    Where the pointer is, in the surface's space.

  • public float Y

    Ditto.

  • public DataObject Data

    What would be dropped.

  • public UiElement? DragSource

    The element the drag started on.

  • public DropEffect Allowed

    Everything the source is willing to have happen.

  • public DropEffect Effect

    What this target would do, which it may narrow or refuse.

Used by (7)

  • BuildContextVixen.Ui
  • CompositionTestsVixen.Ui.Tests
  • DropSheetVixen.Ui.Controls.Tests
  • DroppedVixen.Ui.Tests
  • InAppDragTestsVixen.Ui.Tests
  • KeyboardDragTestsVixen.Ui.Tests
  • UiDocumentVixen.Ui