internal void AdjustScrollForItemUpdate() { if (ItemsView.ItemsUpdatingScrollMode == ItemsUpdatingScrollMode.KeepLastItemInView) { ScrollTo(new ScrollToRequestEventArgs(ItemsViewAdapter.ItemCount, 0, System.Maui.ScrollToPosition.MakeVisible, true)); } else if (ItemsView.ItemsUpdatingScrollMode == ItemsUpdatingScrollMode.KeepScrollOffset) { ScrollHelper.UndoNextScrollAdjustment(); } }
protected virtual void ScrollTo(ScrollToRequestEventArgs args) { var position = DetermineTargetPosition(args); if (args.IsAnimated) { ScrollHelper.AnimateScrollToPosition(position, args.ScrollToPosition); } else { ScrollHelper.JumpScrollToPosition(position, args.ScrollToPosition); } }