public static MoveWithRotationAndFadeOut ( |
||
element | ||
to | Point | |
rotationAngle | double | |
seconds | double | |
callback | AnimationCompletedDelegate | |
return | void |
/// <summary> /// Animates the Pointer Arrow from the right hand to the rectangle /// </summary> public void AnimatePointerArrow() { if (!pointerAnimationRunning) { pointerAnimationRunning = true; Canvas.SetLeft(PointerArrow, _handPoint.X - (PointerArrow.Width / 2)); Canvas.SetTop(PointerArrow, _handPoint.Y - (PointerArrow.Height / 2)); Point innerRectMiddlePoint = new Point(_innerRect.Left + (_innerRect.Width / 2), _innerRect.Top + (_innerRect.Height / 2)); Vector handToRectVector = new Vector(innerRectMiddlePoint.X - _handPoint.X, innerRectMiddlePoint.Y - _handPoint.Y); // new Vector ist der Vektor von Handposition auf selber ebene nach links double rotateAngle = getRotateAngle(handToRectVector, new Vector(-10, 0)); // Drehrichtung des Pfeiles in Oberen Haelfte umdrehen if (_handPoint.Y < innerRectMiddlePoint.Y) { rotateAngle = -rotateAngle; } double duration = 1.3; Animate.MoveWithRotationAndFadeOut(PointerArrow, new Point(handToRectVector.X, handToRectVector.Y), rotateAngle, duration, ArrowAnimationCompleted); } }