This method is for virtualization usage only. It is not guaranteed to fire for all visible items when the List is removed from the screen. Additionally it fires during virtualization, which may not correspond directly with removal from the screen depending on the platform virtualization technique used.
Event that is fired when one of the ScrollTo methods is invoked. The ScrollToRequestedEventArgs object that accompanies the ScrollToRequested event has many properties. These properties are set from the arguments specified in the ScrollTo method calls.
let items = [ 1 .. 1000 ]
(ListView(items)
(fun item -> TextCell($"{item}")))
.header(Label("I'm a header"))
.footer(Label("I'm a footer"))
.hasEvenRows(true)
.horizontalScrollBarVisibility(ScrollBarVisibility.Never)
.onItemTapped(ItemTapped)
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 in 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}"))
Get access to the underlying Xamarin.Forms.ListView #
let listViewRef = ViewRef<ListView>()
(ListView(items)
(fun item -> TextCell($"{item}")))
.reference(listViewRef)