Skip to content

ListItemContext<T>

Namespace: Hex1b

Assembly: Hex1b.dll

Context passed to an ItemTemplate callback on . Exposes the per-row item value alongside the row's current focus, selection, and hover state so the template can decide how to style itself. Derives from so the usual fluent extension methods (context.Text(...), context.VStack(...), etc.) are available inside the builder.

csharp
public sealed class ListItemContext<T> : WidgetContext<ListWidget<T>>

Inheritance

Object → WidgetContext<ListWidget<<T>>> → ListItemContext<T>

Properties

Index

The zero-based index of this row in the source Items list.

Returns: Int32

csharp
public int Index { get; }

IsFocused

True when this row is the list's currently focused (cursor) row.

Returns: Boolean

csharp
public bool IsFocused { get; }

IsHovered

True when the mouse is currently hovering over this row.

Returns: Boolean

csharp
public bool IsHovered { get; }

IsLoaded

True when was materialised from the data source for this row. Always true in non-virtualized mode. In virtualized mode this is false only for rows whose data is still in-flight — templates can branch on this to render a placeholder (e.g. a loading spinner) instead of dereferencing a possibly default(T) item.

Returns: Boolean

csharp
public bool IsLoaded { get; }

IsSelected

True when the list's multi-select feature is enabled and this row is part of the checked set. Always false when multi-select is off — the cursor row is reported through , not here.

Returns: Boolean

csharp
public bool IsSelected { get; }

Item

The item value backing this row.

Returns: <T>

csharp
public T Item { get; }

OwnerHasFocus

True when the list itself currently holds keyboard focus.

Returns: Boolean

csharp
public bool OwnerHasFocus { get; }

Released under the MIT License.