/// <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); } }
private void setRectVisible() { Animate.Opacity(ArrowLeftViewBox, ArrowLeftViewBox.Opacity, 1, 0.2); Animate.Opacity(ArrowRightViewBox, ArrowRightViewBox.Opacity, 1, 0.2); Animate.Opacity(TopTextViewBox, TopTextViewBox.Opacity, 1, 0.2); Animate.Opacity(BottomTextViewBox, BottomTextViewBox.Opacity, 1, 0.2); Animate.Opacity(Hand, Hand.Opacity, 1, 0.2); Animate.Opacity(InnerRect, InnerRect.Opacity, 1, 0.2); PointerArrow.Visibility = Visibility.Hidden; }