Hello. I'm using Forms 1.4.2.6359 and I have a ListView
with HasUnevenRows = true
. I'm trying to get the ListView
to scroll to the last item in the list after its ItemSource is asynchronously populated after the view initially loads, but I'm not sure it's working as expected. I should also mention that the row heights vary widely.
Is there anything wrong with the following code -- am I using the ListView.ScrollTo
method incorrectly or am I missing something here?
public Task NotifyDataLoadedAsync ()
{
var lastMessage = this.MessagesListView.ItemsSource.Cast<object> ().LastOrDefault ();
if (null != lastMessage) {
this.MessagesListView.ScrollTo (lastMessage, ScrollToPosition.End, true);
}
return Task.FromResult (0);
}