Virtualized collections
Usages
let items = [ 1 .. 1000 ]
ListView(items)
(fun item -> TextCell($"{item}"))
CollectionView(items)
(fun item -> Label($"{item}"))// According to Xamarin.Forms documentation, when grouping, data source should be an IEnumerable of IEnumerable
type Group(headerData: string, footerData: string, items: IEnumerable<int>) =
inherit ObservableCollection<int>(items)
member _.HeaderData = headerData
member _.FooterData = footerData
let groups =
ObservableCollection<Group>(
[ for i = 0 .. 100 do
Group($"Header {i}", $"Footer {i}", [1 .. 100]) ]
)
// ListView has no Footer for groups
GroupedListView(groups)
(fun group -> TextCell(group.HeaderData))
(fun item -> TextCell($"{item}"))
GroupedCollectionView(items)
(fun group -> Label(group.HeaderData))
(fun item -> Label($"{item}")
(fun group -> Label(group.FooterData))How ListView and CollectionView work in Xamarin.Forms
How it works in Fabulous
Simple collections (aka not grouped)
Grouped collections
Last updated