private void AnimateAxes(AnimationContext context) { double from; double to; PerspectiveAnimationAxis axes = this.Axes; double duration = this.Duration.TimeSpan.TotalSeconds; if ((axes & PerspectiveAnimationAxis.X) == PerspectiveAnimationAxis.X) { // animate the X-axis from = this.StartAngleX; to = this.EndAngleX; this.UpdateStartEnd(ref from, ref to); context.RotationX(new double[] { 0, from, duration, to }); } if ((axes & PerspectiveAnimationAxis.Y) == PerspectiveAnimationAxis.Y) { // animate the Y-axis from = this.StartAngleY; to = this.EndAngleY; this.UpdateStartEnd(ref from, ref to); context.RotationY(new double[] { 0, from, duration, to }); } if ((axes & PerspectiveAnimationAxis.Z) == PerspectiveAnimationAxis.Z) { // animate the Y-axis from = this.StartAngleZ; to = this.EndAngleZ; this.UpdateStartEnd(ref from, ref to); context.RotationZ(new double[] { 0, from, duration, to }); } }