Table of Contents

Class DragDropSession

Namespace
Icy.Input.DragDrop
Assembly
IcyUI.dll

State for one active cross-container drag gesture, from the moment an IDragSource accepts it (see TryBeginDrag(Point, out object?, out UIElement?)) until the gesture ends.

public sealed class DragDropSession
Inheritance
DragDropSession
Inherited Members
Extension Methods

Remarks

Created and owned entirely by Canvas - an IDragSource/IDropTarget only ever observes one handed to it, never constructs one itself.

Constructors

DragDropSession(UIElement, object, Point)

Initializes a new instance of the DragDropSession class.

public DragDropSession(UIElement source, object payload, Point screenPoint)

Parameters

source UIElement

The element that started the drag (see TryBeginDrag(Point, out object?, out UIElement?)).

payload object

The data carried for the duration of the drag.

screenPoint Point

The drag's starting position, in screen/window space.

Properties

CurrentTarget

Gets the IDropTarget currently under the cursor and willing to accept this session (see CanDrop(DragDropSession)), or null when nothing under the cursor accepts it.

public IDropTarget? CurrentTarget { get; }

Property Value

IDropTarget

Payload

Gets the data carried for the duration of this drag, as supplied by Source.

public object Payload { get; }

Property Value

object

Preview

Gets the element rendered via Overlays and repositioned to follow the cursor for the rest of the gesture - set once, from TryBeginDrag(Point, out object?, out UIElement?)'s own preview output.

public UIElement? Preview { get; }

Property Value

UIElement

ScreenPoint

Gets the drag's current position, in screen/window space - updated every frame by Canvas as the gesture continues.

public Point ScreenPoint { get; }

Property Value

Point

Source

Gets the element that started this drag.

public UIElement Source { get; }

Property Value

UIElement