/// <summary>
        /// Animates the rotation in degrees of the the UIElement.
        /// </summary>
        /// <param name="associatedObject">The UI Element to rotate.</param>
        /// <param name="value">The value in degrees to rotate.</param>
        /// <param name="centerX">The center x in pixels.</param>
        /// <param name="centerY">The center y in pixels.</param>
        /// <param name="duration">The duration in milliseconds.</param>
        /// <param name="delay">The delay in milliseconds. (ignored if duration == 0)</param>
        /// <returns>
        /// An AnimationSet.
        /// </returns>
        public static AnimationSet Rotate(
            this UIElement associatedObject,
            float value     = 0f,
            float centerX   = 0f,
            float centerY   = 0f,
            double duration = 500d,
            double delay    = 0d)
        {
            if (associatedObject == null)
            {
                return(null);
            }

            var animationSet = new AnimationSet(associatedObject);

            return(animationSet.Rotate(value, centerX, centerY, duration, delay));
        }
Beispiel #2
0
        /// <summary>
        /// Animates the rotation in degrees of the UIElement.
        /// </summary>
        /// <param name="associatedObject">The UI Element to rotate.</param>
        /// <param name="value">The value in degrees to rotate.</param>
        /// <param name="centerX">The center x in pixels.</param>
        /// <param name="centerY">The center y in pixels.</param>
        /// <param name="duration">The duration in milliseconds.</param>
        /// <param name="delay">The delay in milliseconds. (ignored if duration == 0)</param>
        /// <param name="easingType">Used to describe how the animation interpolates between keyframes.</param>
        /// <param name="easingMode">EasingMode used to interpolate between keyframes.</param>
        /// <returns>
        /// An AnimationSet.
        /// </returns>
        public static AnimationSet Rotate(
            this UIElement associatedObject,
            float value           = 0f,
            float centerX         = 0f,
            float centerY         = 0f,
            double duration       = 500d,
            double delay          = 0d,
            EasingType easingType = EasingType.Default,
            EasingMode easingMode = EasingMode.EaseOut)
        {
            if (associatedObject == null)
            {
                return(null);
            }

            var animationSet = new AnimationSet(associatedObject);

            return(animationSet.Rotate(value, centerX, centerY, duration, delay, easingType));
        }