A high-performance virtualized list control for displaying large collections of data. Only renders visible items to optimize memory and performance. Supports vertical and horizontal orientations and observable collections.
Basic Usage
// Simple vertical listnewItemsList<Person>().SetItemsSource(people).SetItemTemplate((person,index)=>newLabel().SetText(person.Name))// Horizontal list (card carousel)newItemsList<Product>().SetItemsSource(products).SetOrientation(Orientation.Horizontal).SetItemTemplate((product,index)=>newVStack(newImage().SetImageSource(product.ImageUrl),newLabel().SetText(product.Name)))// Bound to observable collectionnewItemsList<TodoItem>().BindItemsSource(nameof(vm.TodoItems),()=>vm.TodoItems).SetItemTemplate((item,index)=>newHStack(newCheckbox().BindIsChecked(nameof(item.IsComplete),()=>item.IsComplete,v=>item.IsComplete=v),newLabel().BindText(nameof(item.Title),()=>item.Title)))
ItemsList-Specific Methods
Data Methods
Method
Description
SetItemsSource(IEnumerable<T>?)
Sets the data source
BindItemsSource(name, getter)
Binds data source (supports INotifyCollectionChanged)
SetItemTemplate(Func<T, int, UiElement>)
Sets the template function for creating item UI
BindItemTemplate(name, getter)
Binds item template
Scroll Methods
Method
Description
SetScrollOffset(float)
Sets scroll position in pixels
BindScrollOffset(name, getter)
Binds scroll offset
SetScrollFactor(float)
Sets scroll speed multiplier (default: 1.0)
BindScrollFactor(name, getter)
Binds scroll factor
Layout Methods
Method
Description
SetOrientation(Orientation)
Sets vertical or horizontal orientation (default: Vertical)
BindOrientation(name, getter)
Binds orientation
Orientation Values
Value
Description
Orientation.Vertical
Items flow top to bottom (default)
Orientation.Horizontal
Items flow left to right
ItemsList uses UI virtualization - only visible items are rendered, making it efficient for thousands of items. It automatically responds to collection changes when using ObservableCollection.
// In ViewModelpublicObservableCollection<Message>Messages{get;}=new();// Adding items automatically updates the listMessages.Add(newMessage{Text="Hello!"});Messages.RemoveAt(0);Messages.Clear();// In ViewnewItemsList<Message>().BindItemsSource(nameof(vm.Messages),()=>vm.Messages).SetItemTemplate((msg,index)=>newLabel().SetText(msg.Text))