CollectionView<TItem, TSection>
| Type parameter | Summary |
|---|---|
(class) TItem | The item type. |
ISection<TItem> TSection | The section model the header and footer templates bind to. |
Properties
AvoidsKeyboard
Whether the collection is inset so the keyboard never covers its content.
Type: bool
EmptyView
Shown instead of the items while the source is empty.
Type: View?
FooterTemplate
Builds a section footer. Bound to the section model.
Type: Func<ItemView<TSection>>?
GroupedItemsSource
Groups, each with its own header. Takes precedence over ItemsSource.
Type: BindableList<TSection>
HeaderTemplate
Builds a section header. Bound to the section model.
Type: Func<ItemView<TSection>>?
HighlightColor
The tapped row's highlight color, or null for the system gray.
Type: Color?
HighlightsSelection
Whether a tapped row shows a highlight until the page is next appeared.
Type: bool
IndexTitles
Explicit labels for the fast-scroll index, or null to show one per section.
A tapped letter with no section jumps to the nearest one at or after it.
Has no effect without
SectionIndexTitle, which still supplies each section's letter.
Type: IReadOnlyList<string>?
IsEditing
Whether the collection is in edit mode, showing selection circles and reorder handles.
IsRefreshing
Whether the refresh spinner is showing.
With a two-way binding, pulling sets it to true and the ViewModel sets it to false when done.
ItemCommand
Command invoked with the tapped item.
Type: ICommand?
ItemContextMenu
Entries in a row's long-press context menu.
Each command is invoked with the row's item.
Type: IList<MenuAction>
ItemPreview
Builds the floating preview shown over a row's context menu, given the row's item.
Without it the row itself is the preview.
ItemTemplate
Builds the element tree for a cell. Called once per recycled cell, never per item.
ItemsSource
The items to show.
Changes animate into place when the list is an
ObservableCollection.
Type: BindableList<TItem>
KeyboardDismiss
How dragging the collection dismisses the keyboard.
Type: KeyboardDismiss
Layout
How the items are arranged.
Type: CollectionLayout
LoadMoreCommand
Invoked when the user scrolls within LoadMoreThreshold items of the end.
Fires once per item count.
Type: ICommand?
LoadMoreCommandParameter
The parameter passed to LoadMoreCommand.
Type: object?
LoadMoreThreshold
How many items from the end LoadMoreCommand fires at.
Type: int
Prefetch
Maps an item to the image url to warm before its row scrolls on.
Setting it enables prefetching through the app's image loader.
PreviewCommand
Invoked with the row's item when its context-menu preview is tapped.
Type: ICommand?
PreviewShape
Shapes the row itself as the lifted platter: padding around the content and a corner radius.
Null keeps the system shape.
Type: PreviewShape?
RefreshCommand
Command invoked when the user pulls to refresh.
Setting it installs the refresh control. The
ICommand.CanExecutecontrols whether the user can pull to refresh.
Type: ICommand?
RefreshCommandParameter
The parameter passed to RefreshCommand.
Type: object?
ReorderCommand
Invoked after a drag-to-reorder with an ItemMove<TItem>.
Setting it enables a long-press drag, unless a context menu owns that gesture; the edit-mode handle always drags.
The move is already applied to the source when it fires.
Type: ICommand?
Scrolled
Invoked as the collection scrolls, with the vertical offset in points.
SectionIndexTitle
Maps a section to its letter in the fast-scroll index, or null for no index.
Grouped list layouts only. Tapping a letter jumps to that section.
SectionLayout
Gives each section its own layout, or null to arrange every section with Layout.
Mixes arrangements in one collection, like a carousel row above a list. Every section shares the one
ItemTemplate.
Type: Func<TSection, CollectionLayout>?
SelectedItems
The items checked while editing.
Give it an
ObservableCollection: taps keep it in sync, and mutating it moves the checkmarks.
Type: BindableList<TItem>
SeparatorInsets
Leading/trailing insets for the separator lines, or null for the system default.
List layouts only.
Type: Thickness?
ShowsSeparators
Whether rows draw their separator lines.
List layouts only.
Type: bool
SwipeActions
Actions revealed by swiping a row.
List layouts only.
Type: IList<SwipeAction>
Methods
MeasureOverride
Content measurement. Panels recurse; controls delegate to the native SizeThatFits.
| Parameter | Summary |
|---|---|
Size availableSize | The size available for the view's content. |
Returns
Size: The desired content size.
ScrollTo
Scrolls the list until item is visible, aligned to the given viewport edge.
| Parameter | Summary |
|---|---|
TItem item | The item to bring into view. |
(optional) ScrollPosition position | The viewport edge the item aligns to. |
(optional) bool animated | Whether the scroll is animated. |