BaseListView
Base class for a list view, a vertically scrollable area that links to, and displays, a list of items.
Read time 11 minutesLast updated 4 days ago
Definition
- Type: Class
- Namespace: UnityEngine.UIElements
- Assembly: UnityEngine.UIElementsModule
- Inherits from: BaseVerticalCollectionView
- Implements: IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IBindable, ISerializationCallbackReceiver
public abstract class BaseListView : BaseVerticalCollectionView, IEventHandler, IResolvedStyle, ITransform, ITransitionAnimations, IExperimentalFeatures, IVisualElementScheduler, IBindable, ISerializationCallbackReceiver
Static Fields
Value | Description |
|---|---|
| arraySizeFieldUssClassName | The USS class name for the size field of the ListView when show bound collection size is enabled |
| arraySizeFieldWithFooterUssClassName | The USS class name for the size field of the ListView when the footer is enabled. |
| arraySizeFieldWithHeaderUssClassName | The USS class name for the size field of the ListView when foldout header is enabled. |
| emptyLabelUssClassName | The USS class name for label displayed when ListView is empty. |
| foldoutHeaderUssClassName | The USS class name for the foldout header of the ListView. |
| footerAddButtonName | The name of the add button element in the footer. |
| footerRemoveButtonName | The name of the remove button element in the footer. |
| footerUssClassName | The USS class name for the footer of the ListView. |
| itemUssClassName | The USS class name of item elements in ListView elements. |
| listViewWithFooterUssClassName | The USS class name for ListView when add/remove footer is enabled. |
| listViewWithHeaderUssClassName | The USS class name for ListView when foldout header is enabled. |
| overMaxMultiEditLimitClassName | The USS class name for label displayed when ListView is trying to edit too many items. |
| reorderableItemContainerUssClassName | The USS class name for item container in reorderable animated ListView. |
| reorderableItemHandleBarUssClassName | The USS class name for drag handle bar in reorderable animated ListView. |
| reorderableItemHandleUssClassName | The USS class name for drag handle in reorderable animated ListView. |
| reorderableItemUssClassName | The USS class name for item elements in reorderable animated ListView. |
| reorderableUssClassName | The USS class name for reorderable animated ListView elements. |
| scrollViewWithFooterUssClassName | The USS class name for scroll view when add/remove footer is enabled. |
| ussClassName | The USS class name for ListView elements. |
Constructors
Constructor | Description |
|---|---|
| BaseListView() | Creates a BaseListView with all default properties. The BaseVerticalCollectionView.itemsSource must all be set for the BaseListView to function properly. |
| BaseListView(System.Collections.IList,System.Single) | Constructs a BaseListView, with all important properties provided. |
Properties
Property | Description |
|---|---|
| allowAdd | This property allows the user to allow or block the addition of an item when clicking on the Add Button. It must return |
| allowRemove | This property allows the user to allow or block the removal of an item when clicking on the Remove Button. It must return |
| bindingSourceSelectionMode | This property controls whether every element in the list will get its data source setup automatically to the correct item in the collection's source. |
| headerTitle | This property controls the text of the foldout header when using BaseListView.showFoldoutHeader. |
| makeFooter | This callback allows the user to make their own footer for this control. |
| makeHeader | This callback allows the user to make their own header for this control. |
| makeNoneElement | This callback allows the user to set a Visual Element to replace the "List is empty" Label shown when the ListView is empty. |
| onAdd | This callback allows the user to implement their own code to be executed when the Add Button is clicked. |
| onRemove | This callback allows the user to implement their own code to be executed when the Remove Button is clicked. |
| overridingAddButtonBehavior | This callback allows the user to implement a DropdownMenu when the Add Button is clicked. |
| reorderMode | This property controls the drag and drop mode for the list view. |
| showAddRemoveFooter | This property controls whether a footer will be added to the list view. |
| showBoundCollectionSize | This property controls whether the list view displays the collection size (number of items). |
| showFoldoutHeader | This property controls whether the list view displays a header, in the form of a foldout that can be expanded or collapsed. |
| viewController | The view controller for this view, cast as a BaseListViewController. |
Methods
Method | Description |
|---|---|
| SetViewController | Assigns the view controller for this view and registers all events required for it to function properly. |
Events
Member | Description |
|---|---|
| itemsAdded | This event is called for every item added to the itemsSource. Includes the item index. |
| itemsRemoved | This event is called for every item removed from the itemsSource. Includes the item index. |