Exemplo n.º 1
0
        internal override void MoveStick()
        {
            var value = Value;
            if (value < FromValue)
            {
                value = FromValue;
            }
            if (value > ToValue)
            {
                value = ToValue;
            }
            Wedge = Wedge > 360 ? 360 : (Wedge < 0 ? 0 : Wedge);

            var fromAlpha = (360 - Wedge) * .5;
            var toAlpha = 360 - fromAlpha;

            var alpha = LinearInterpolation(fromAlpha, toAlpha, FromValue, ToValue, value);

            if (DisableaAnimations)
            {
                StickRotateTransform.Angle = alpha;
            }
            else
            {
                StickRotateTransform.BeginAnimation(RotateTransform.AngleProperty,
                    new DoubleAnimation(alpha, AnimationsSpeed));
            }
        }
        private void MoveStick()
        {
            Wedge = Wedge > 360 ? 360 : (Wedge < 0 ? 0 : Wedge);

            var fromAlpha = (360 - Wedge) * .5;
            var toAlpha   = 360 - fromAlpha;

            var alpha = LinearInterpolation(fromAlpha, toAlpha, From, To, Value) + 180;

            if (DisableAnimations)
            {
                StickRotateTransform.Angle = alpha;
            }
            else
            {
                StickRotateTransform.BeginAnimation(RotateTransform.AngleProperty,
                                                    new DoubleAnimation(alpha, AnimationsSpeed));
            }
        }