Beispiel #1
0
        void Move(NotifyCollectionChangedEventArgs args)
        {
            var count = args.NewItems.Count;

            ResetGroupTracking();

            if (count == 1)
            {
                // For a single item, we can use MoveSection and get the animation
                Update(() => _collectionView.MoveSection(args.OldStartingIndex, args.NewStartingIndex));
                return;
            }

            var start = Math.Min(args.OldStartingIndex, args.NewStartingIndex);
            var end   = Math.Max(args.OldStartingIndex, args.NewStartingIndex) + count;

            Update(() => _collectionView.ReloadSections(CreateIndexSetFrom(start, end)));
        }