/// <summary>
        /// Animates the opacity of the the UIElement.
        /// </summary>
        /// <param name="associatedObject">The UI Element to change the opacity of.</param>
        /// <param name="value">The fade value, between 0 and 1.</param>
        /// <param name="duration">The duration in milliseconds.</param>
        /// <param name="delay">The delay. (ignored if duration == 0)</param>
        /// <returns>
        /// An AnimationSet.
        /// </returns>
        public static AnimationSet Fade(
            this UIElement associatedObject,
            float value     = 0f,
            double duration = 500d,
            double delay    = 0d)
        {
            if (associatedObject == null)
            {
                return(null);
            }

            var animationSet = new AnimationSet(associatedObject);

            return(animationSet.Fade(value, duration, delay));
        }
Exemplo n.º 2
0
        /// <summary>
        /// Animates the opacity of the UIElement.
        /// </summary>
        /// <param name="associatedObject">The UI Element to change the opacity of.</param>
        /// <param name="value">The fade value, between 0 and 1.</param>
        /// <param name="duration">The duration in milliseconds.</param>
        /// <param name="delay">The delay. (ignored if duration == 0)</param>
        /// <param name="easingType">Used to describe how the animation interpolates between keyframes.</param>
        /// <param name="easingMode">The easing mode to use to interpolate between keyframes.</param>
        /// <returns>
        /// An AnimationSet.
        /// </returns>
        public static AnimationSet Fade(
            this UIElement associatedObject,
            float value           = 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.Fade(value, duration, delay, easingType, easingMode));
        }