Skip to content
Version 2.32.0
↓ Get the launcher

ListElement.OnReorder property

Optional — turns on drag-and-drop REORDERING of the visible items. A press on an item that moves past a small threshold (~6 screen px) starts a drag: the item dims, a ghost follows the cursor and an accent bar marks the insertion point (between grid cells, or between rows for a 1-column list). Dropping fires OnReorder(from, to) with REMOVE-THEN-INSERT semantics — to is the item’s index AFTER the move, so the consumer does var x = list[from]; list.RemoveAt(from); list.Insert(to, x);. It never fires for a no-op drop (from == to). Esc, or a drop outside the list (outside its scroll viewport when it sits in a ScrollElement), cancels. A press released before the threshold is an ordinary click (the item’s own OnClick still fires); after a real drag the click is swallowed. The drag never moves the window or scrolls the enclosing scroll view. The grid does not reflow mid-drag — the consumer reorders its data and the list re-pulls. Default null = not reorderable. Init property, NOT a ctor param (binary compatibility).

public Action<int, int>? OnReorder { get; set; }