示例#1
0
 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();
     }
 }
示例#2
0
        protected virtual void ScrollTo(ScrollToRequestEventArgs args)
        {
            var position = DetermineTargetPosition(args);

            if (args.IsAnimated)
            {
                ScrollHelper.AnimateScrollToPosition(position, args.ScrollToPosition);
            }
            else
            {
                ScrollHelper.JumpScrollToPosition(position, args.ScrollToPosition);
            }
        }