Exemplo n.º 1
0
        internal override void OnAfterItemRemovedAnimationEnded(SingleItemAnimationContext context)
        {
            double startingOffset = context.AssociatedItem.currentOffset;
            double offset         = context.RealizedLength;

            ////Apply the aggregated height correction to all affected visual items reamining on the viewport
            for (int i = 0; i < this.owner.realizedItems.Count; i++)
            {
                RadVirtualizingDataControlItem firstItem = this.owner.realizedItems[i];

                if (firstItem.currentOffset > startingOffset)
                {
                    if (firstItem.previous == null || (firstItem.previous != null && firstItem.previous.currentOffset + this.GetItemLength(firstItem.previous) <= firstItem.currentOffset - offset))
                    {
                        this.SetItemOffset(firstItem, firstItem.currentOffset - offset);
                    }
                    else
                    {
                        break;
                    }
                }
            }

            this.TranslateRemoveAnimatedItemsWithOffset(startingOffset, -offset);

            if (this.owner.IsLoaded)
            {
                this.ManageLowerViewport(false);
                this.CheckBottomScrollableBounds();
            }
        }
Exemplo n.º 2
0
        private void OnItemAddedAnimation_Ended(object sender, AnimationEndedEventArgs e)
        {
            SingleItemAnimationContext context = this.GetAnimationContextForTarget(e.AnimationInfo.Target as RadVirtualizingDataControlItem, true);
            RadAnimation endedAnimation        = sender as RadAnimation;

            this.OnItemAddedAnimationEnded(endedAnimation, context);
        }
Exemplo n.º 3
0
        internal virtual void OnItemRemovedAnimationEnded(RadAnimation animation, SingleItemAnimationContext context)
        {
            // When a remove animation ends we take it from the queue and...
            this.scheduledRemoveAnimations.Remove(context);

            // In case the animated container is already recycled - we hide it. This happens
            // when a single item remove animation has been started, not a batch one.
            if (!this.itemRemovedBatchAnimationScheduled)
            {
                context.AssociatedItem.Visibility = Visibility.Collapsed;
                if (this.realizedItems.Count > 0)
                {
                    this.virtualizationStrategy.OnAfterItemRemovedAnimationEnded(context);
                }
                else
                {
                    this.CleanupAfterCollectionReset();
                }
            }
            else
            {
                context.AssociatedItem.Visibility = Visibility.Collapsed;

                if (this.scheduledRemoveAnimations.Count == 0)
                {
                    this.itemRemovedBatchAnimationScheduled = false;
                    this.CleanupAfterCollectionReset();
                    if (this.listSource.Count == 0)
                    {
                        if (this.ItemsSource == null)
                        {
                            this.ClearReycledItems();
                        }
                    }
                    else
                    {
                        this.BalanceVisualSpace();
                    }
                }
            }

            if (this.scheduledRemoveAnimations.Count == 0)
            {
                this.virtualizationStrategy.RecalculateViewportMeasurements();
            }

            if (this.scheduledRemoveAnimations.Count == 0 && !this.IsLoaded)
            {
                this.itemRemovedAnimationCache.Ended -= this.OnItemRemovedAnimation_Ended;
            }

            this.OnItemAnimationEnded(new ItemAnimationEndedEventArgs()
            {
                Animation = animation, RemainingAnimationsCount = this.scheduledRemoveAnimations.Count
            });
        }
Exemplo n.º 4
0
 internal void StopAllRemovedAnimations()
 {
     while (this.scheduledRemoveAnimations.Count > 0)
     {
         // Here we do not need to enqueue the top item since the ForceStop method will invoke the RadAnimation.Ended event where
         // this is done.
         SingleItemAnimationContext context = this.scheduledRemoveAnimations[0];
         RadAnimationManager.ForceStop(context.AssociatedItem, this.itemRemovedAnimationCache);
     }
 }
Exemplo n.º 5
0
        internal override void OnAfterItemRemovedAnimationEnded(SingleItemAnimationContext context)
        {
            this.ReorderViewportItemsOnItemRemoved(context.RealizedIndex, context.AssociatedItem);

            if (this.owner.IsLoaded)
            {
                this.ManageLowerViewport(false);
                this.CheckBottomScrollableBounds();
            }
        }
Exemplo n.º 6
0
 internal virtual void OnItemAddedAnimationEnded(RadAnimation animation, SingleItemAnimationContext context)
 {
     this.scheduledAddAnimations.Remove(context);
     context.AssociatedItem.scheduledForBatchAnimation = false;
     if (this.scheduledAddAnimations.Count == 0 && !this.IsLoaded)
     {
         this.itemAddedAnimationCache.Ended -= this.OnItemAddedAnimation_Ended;
     }
     this.OnItemAnimationEnded(new ItemAnimationEndedEventArgs()
     {
         Animation = animation, RemainingAnimationsCount = this.scheduledAddAnimations.Count
     });
 }
Exemplo n.º 7
0
        internal override void OnItemRemovedAnimationEnded(RadAnimation animation, SingleItemAnimationContext context)
        {
            base.OnItemRemovedAnimationEnded(animation, context);

            if (this.realizedItems.Count > 0 && this.listSource.Count > 0)
            {
                SingleItemAnimationContext[] animatedItems = this.scheduledRemoveAnimations.ToArray();
                foreach (SingleItemAnimationContext ctxt in animatedItems)
                {
                    if (ctxt.RealizedIndex == 0)
                    {
                        return;
                    }
                }

                this.PositionPullToRefreshIndicator();
            }
        }
Exemplo n.º 8
0
        private void OnItemRemovedAnimation_Ended(object sender, AnimationEndedEventArgs e)
        {
            SingleItemAnimationContext endedAnimation = this.GetAnimationContextForTarget(e.AnimationInfo.Target as RadVirtualizingDataControlItem, false);

            this.OnItemRemovedAnimationEnded(sender as RadAnimation, endedAnimation);
        }
 internal virtual void OnAfterItemRemovedAnimationEnded(SingleItemAnimationContext context)
 {
 }