protected override Storyboard PrepareItemAnimation(ElementFlow owner, int index, ElementFlow.ElementAnimationType type)
        {
            // Initialize storyboard
            Storyboard sb = owner.PrepareTemplateStoryboard(index);

            // Child animations
            Rotation3DAnimation rotAnim = sb.Children[0] as Rotation3DAnimation;
            DoubleAnimation     xAnim   = sb.Children[1] as DoubleAnimation;
            DoubleAnimation     yAnim   = sb.Children[2] as DoubleAnimation;
            DoubleAnimation     zAnim   = sb.Children[3] as DoubleAnimation;

            switch (type)
            {
            case ElementFlow.ElementAnimationType.Left:
                (rotAnim.To as AxisAngleRotation3D).Angle = owner.TiltAngle;
                (rotAnim.To as AxisAngleRotation3D).Axis  = new Vector3D(0, 0, 1);
                xAnim.To = -1 * owner.ItemGap * (owner.SelectedIndex - index);
                yAnim.To = -1 * owner.ItemGap * (owner.SelectedIndex - index);
                zAnim.To = -1 * owner.ItemGap * (owner.SelectedIndex - index);

                break;

            case ElementFlow.ElementAnimationType.Right:
                (rotAnim.To as AxisAngleRotation3D).Angle = owner.TiltAngle;
                (rotAnim.To as AxisAngleRotation3D).Axis  = new Vector3D(0, 0, 1);
                xAnim.To = owner.ItemGap * (index - owner.SelectedIndex);
                yAnim.To = -1 * owner.ItemGap * (index - owner.SelectedIndex);
                zAnim.To = owner.ItemGap * (index - owner.SelectedIndex);

                break;

            case ElementFlow.ElementAnimationType.Selection:
                xAnim.To = -1 * (owner.ItemGap + owner.PopoutDistance);
                yAnim.To = owner.ItemGap;
                break;
            }

            return(sb);
        }
Example #2
0
 protected virtual Storyboard PrepareItemAnimation(ElementFlow owner, int index, ElementFlow.ElementAnimationType type)
 {
     return(null);
 }