/// <summary> /// Animates the offset of the the UIElement. /// </summary> /// <param name="associatedObject">The specified UI Element.</param> /// <param name="offsetX">The offset on the x axis.</param> /// <param name="offsetY">The offset on the y axis.</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 Offset( this UIElement associatedObject, float offsetX = 0f, float offsetY = 0f, double duration = 500d, double delay = 0d) { if (associatedObject == null) { return(null); } var animationSet = new AnimationSet(associatedObject); return(animationSet.Offset(offsetX, offsetY, duration, delay)); }
/// <summary> /// Animates the offset of the UIElement. /// </summary> /// <param name="associatedObject">The specified UI Element.</param> /// <param name="offsetX">The offset on the x axis.</param> /// <param name="offsetY">The offset on the y axis.</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">The EasingMode to use to interpolate between keyframes.</param> /// <returns> /// An AnimationSet. /// </returns> public static AnimationSet Offset( this UIElement associatedObject, float offsetX = 0f, float offsetY = 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.Offset(offsetX, offsetY, duration, delay, easingType, easingMode)); }