public AnimatedStackPanel(IArrangeAnimator animator, TimeSpan animationInterval)
 {
     animationTimer = AnimationBase.CreateAnimationTimer(this, animationInterval);
     Animator = animator;
 }
 public AnimatedLayoutPanel(IArrangeAnimator animator, TimeSpan animationInterval)
 {
     animationTimer = AnimationBase.CreateAnimationTimer(this, animationInterval);
     Animator       = animator;
 }
 public AnimatedUniformGrid(IArrangeAnimator animator, TimeSpan animationInterval)
 {
     animationTimer = AnimationBase.CreateAnimationTimer(this, animationInterval);
     Animator = animator;
 }
Exemple #4
0
        public static void Arrange(double elapsedTime, UIElement owner, UIElementCollection elements, IArrangeAnimator animator)
        {
            foreach (UIElement element in elements)
            {
                Point desiredPosition = (bool)element.GetValue(AnimationBase.OverrideArrangeProperty) ? (Point)element.GetValue(AnimationBase.OverridePositionProperty) : element.TranslatePoint(new Point(), owner);
                Size  desiredSize     = (bool)element.GetValue(AnimationBase.OverrideArrangeProperty) ? (Size)element.GetValue(AnimationBase.OverrideSizeProperty) : element.RenderSize;

                Point currentPosition = (Point)element.GetValue(AnimationBase.CurrentPositionProperty);
                Size  currentSize     = (Size)element.GetValue(AnimationBase.CurrentSizeProperty);

                Rect rect = animator.Arrange(elapsedTime, desiredPosition, desiredSize, currentPosition, currentSize);

                element.SetValue(AnimationBase.CurrentPositionProperty, rect.TopLeft);
                element.SetValue(AnimationBase.CurrentSizeProperty, rect.Size);


                element.Arrange(rect);
            }
        }