Documentation

Unity Engine


User Manual

Script Reference

Unity Engine


CollectionViewController

Base collection view controller. View controllers are meant to take care of data virtualized by any BaseVerticalCollectionView inheritor.
Read time 1 minuteLast updated 4 days ago

Definition

public abstract class CollectionViewController : IDisposable

Remarks

For the difference between IDs and indices, refer to BaseVerticalCollectionView.

Properties

Property

Description

itemsSourceThe items source stored in a non-generic list.
viewThe view for this controller.

Methods

Method

Description

BindItemBinds a row to an item index.
DestroyItemDestroys a VisualElement when the view is rebuilt or cleared.
DisposeCalled when this controller is not longer needed to provide a way to release resources.
GetIdForIndexReturns the id for the specified index.
GetIndexForIdReturns the index for the specified id.
GetItemForIdReturns the item with the specified ID.
GetItemForIndexReturns the item with the specified index.
GetItemsCountReturns the expected item count in the source.
MakeItemCreates a VisualElement to use in the virtualization of the collection view.
PrepareViewInitialization step once the view is set.
RaiseItemIndexChangedInvokes the _itemIndexChanged event.
RaiseItemsSourceChangedInvokes the _itemsSourceChanged event.
SetItemsSourceWithoutNotifySet the _itemsSource without raising the _itemsSourceChanged event.
SetViewSets the view for this controller.
UnbindItemUnbinds a row to an item index.

Events

Member

Description

itemIndexChangedRaised when an item in the source changes index. The first argument is source index, second is destination index.
itemsSourceChangedRaised when the _itemsSource changes.