ListElement record
Variable-length list, bounded by Slots.Count. All slots built once; the first VisibleCount() are SetActive-shown each refresh. Columns>1 grids them. CellWidth/CellHeight (when > 0, multi-column only) override the grid’s default cell size — use to widen columns past the framework default (e.g. the StatInspector mini-HUD, whose icon+label+value row needs more than the default cell width).
public record ListElement : IEquatable<HudElement>Public Members
Section titled “Public Members”| name | description |
|---|---|
| ListElement(…) | Variable-length list, bounded by Slots.Count. All slots built once; the first VisibleCount() are SetActive-shown each refresh. Columns>1 grids them. CellWidth/CellHeight (when > 0, multi-column only) override the grid’s default cell size — use to widen columns past the framework default (e.g. the StatInspector mini-HUD, whose icon+label+value row needs more than the default cell width). |
| CanReorder { get; set; } | Optional, with OnReorder: whether the item at index i can be PICKED UP right now (polled on the press). False = a press on it is an ordinary click and never starts a drag; it is still a drop target. Use it to lock items (a faded placeholder) or the whole list for a while (return false for every index, e.g. while a filter makes the order ambiguous). Default null = every item can be dragged. Framework 2.30.0; init property (binary compatibility). |
| CellHeight { get; set; } | |
| CellWidth { get; set; } | |
| Columns { get; set; } | |
| FillWidth { get; set; } | Multi-column grid only: when true, the grid FLOWS to fill the container width instead of using the fixed Columns count — it packs as many CellWidth×CellHeight cells per row as the current width allows and wraps to new rows, re-flowing automatically when the window resizes (so the grid fills a wide/resized popover instead of leaving dead space on the right). Columns becomes advisory under this mode, and CellWidth MUST be > 0 (it drives the flowed cell size). Default false = the fixed-column grid, byte-identical for every existing caller. Added as an init property (NOT a positional ctor param) so the record stays source + binary compatible with already-compiled plugins — a new ctor param would be a MissingMethodException at runtime (see WindowBuilder-Patterns.md “Binary compatibility rules”). |
| Gap { get; set; } | Optional spacing between items, in canvas units (both axes for a grid). Default null = the framework’s 2-unit list spacing, unchanged. Framework 2.30.0; init property (binary compatibility). |
| Horizontal { get; set; } | Lay the items out in ONE ROW (side by side, the list as wide as its visible items) instead of a column or a grid; Columns / CellWidth / CellHeight are ignored. With OnReorder the insertion bar sits left/right of an item. Default false = unchanged. Framework 2.30.0; init property (binary compatibility). |
| OnReorder { get; set; } | 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). |
| Slots { get; set; } | |
| VisibleCount { get; set; } |
See Also
Section titled “See Also”- record HudElement
- namespace Stellar.Abstractions.Services