ListControl Class

Description

Base class to create a reorderable list.

public abstract class ListControl : VisualElement, IEventHandler, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IResolvedStyle
Inheritance
Derived

Constructors

ListControl()

Fields

boxedUssClassName

USS class name of Lists drawn inside a box.

draggedItemUssClassName

USS class name of an item that's being dragged.

draggingListUssClassName

USS class name of Lists in the middle of a drag operation.

dropIndicatorUssClassName

USS class name of the drop indicator bar for Drag and Drop.

emptyMessageUssClassName

USS class name of a message to indicate the list is empty.

emptyUssClassName

USS class name of Empty Lists.

foldedUssClassName

USS class name of Lists that are folded (hidden except for the header).

footerUssClassName

USS class name of the list's footer.

headerUssClassName

USS class name of the list's header.

itemUssClassName

USS class name of the list's items.

selectedItemUssClassName

USS class name of an item that's selected.

ussClassName

USS class name of elements of this type.

withFooterUssClassName

USS class name of Lists with a footer.

withHeaderUssClassName

USS class name of Lists with a header.

Properties

boxed

Whether the list is drawn inside a box.

emptyListMessage

A message to indicate that the list is empty. Set it to null to hide it.

selectedItem

The index of the selected item when supportItemSelection is true. Returns -1 when no item is selected.

supportItemSelection

Whether a list item can be selected. It's false by default.

Methods

CreateItemForIndex(Int32)

Implement this method to create the list's items.

GetListItem(Int32)

Get an item from the list.

GetListSize()

Get the item count of the list.

IsReorderable()

Override this method to define whether a list is reorderable.

OnCustomDragPerformed(Int32)

Called when the mouse is released and VerifyCustomDrag(Int32) returns a valid mode.

OnReorderDragPerformed(Int32, Int32)

Implement this method to do the actual reordering of the data backing the list control.

SetFooterContent(VisualElement)

Set the footer's content.

SetFooterVisibility(Boolean)

Set whether to show the list's footer.

SetHeaderContent(VisualElement)

Set the header's content.

SetHeaderVisibility(Boolean)

Set whether to show the list's header.

SetListSize(Int32)

Set the number of items in the list. It will call CreateItemForIndex(Int32) to create items if needed.

StartDraggingItem(Int32)

Start dragging an item to reorder the list. Only call this from mouse events where a button is pressed to avoid errors.

VerifyCustomDrag(Int32)

Implement this method to support dragging other than list reordering (i.e. to insert objects). Return anything other than Rejected and None to support custom dragging. Use it together with OnCustomDragPerformed(Int32).

Extension Methods

UIToolkitExtensions.GetLocalRect(VisualElement)
UIToolkitExtensions.GetChildren<TElement>(VisualElement, List<TElement>, Func<TElement, Boolean>)
UIToolkitExtensions.GetFirstChild<TElement>(VisualElement, Func<TElement, Boolean>)
UIToolkitExtensions.ForEachChild<TElement>(VisualElement, Action<TElement>)