/// <summary> /// Creates the slide animation. /// </summary> /// <param name="control">The control for which the animation is needed.</param> /// <param name="target">The targeted element of the animation.</param> /// <returns>The newly created animation.</returns> protected override Storyboard CreateAnimationOverride(FrameworkElement control, FrameworkElement target) { return(AnimationExtensions.Create() .Animate(target) .SingleProperty(ClipStartXProperty, 0, 0, 0, 0, 0, 0) .SingleProperty(ClipStartYProperty, 0, 0, 0, 0, 0, 0) .EnsureDefaultTransforms() .MoveX(0, 0, 0, 0, 0, 0) .MoveY(0, 0, 0, 0, 0, 0) .Instance); }
/// <summary> /// Creates the slide animation. /// </summary> /// <param name="control">The control for which the animation is needed.</param> /// <param name="target">The targeted element of the animation.</param> /// <returns>The newly created animation.</returns> protected override Storyboard CreateAnimationOverride(FrameworkElement control, FrameworkElement target) { var relativeFrom = this.GetValueDependingOnDirection(this.MinOpacity, this.MaxOpacity); var relativeTo = this.GetValueDependingOnDirection(this.MaxOpacity, this.MinOpacity); var result = AnimationExtensions.Create() .Animate(target) .Opacity(0, relativeFrom, 0, relativeTo) .AdjustSpeed() .Instance; return(result); }
/// <summary> /// Creates the slide animation. /// </summary> /// <param name="control">The control for which the animation is needed.</param> /// <param name="target">The targeted element of the animation.</param> /// <returns>The newly created animation.</returns> protected override Storyboard CreateAnimationOverride(FrameworkElement control, FrameworkElement target) { var nonZeroValue = this.SlideMode == SlideMode.Top ? 1.0 : -1.0; var relativeFrom = this.GetValueDependingOnDirection(nonZeroValue, 0.0); var relatoveTo = this.GetValueDependingOnDirection(0.0, nonZeroValue); var result = AnimationExtensions.Create() .Animate(target) .EnsureDefaultTransforms() .EnsureOpacityMask() .OpacityMaskRelativeMoveY(0, relativeFrom, 0, relatoveTo) .MoveY(0, 0, 0, 0) .Instance; return(result); }
/// <summary> /// Creates the slide animation. /// </summary> /// <param name="control">The control for which the animation is needed.</param> /// <param name="target">The targeted element of the animation.</param> /// <returns>The newly created animation.</returns> protected override Storyboard CreateAnimationOverride(FrameworkElement control, FrameworkElement target) { var relativeFrom = this.GetValueDependingOnDirection(this.MinScale, this.MaxScale); var relatoveTo = this.GetValueDependingOnDirection(this.MaxScale, this.MinScale); target.RenderTransformOrigin = new Point(0.5, 0.5); var result = AnimationExtensions.Create() .Animate(target) .EnsureDefaultTransforms() .ScaleX(0, relativeFrom, 0, relatoveTo) .ScaleY(0, relativeFrom, 0, relatoveTo) .AdjustSpeed() .Instance; return(result); }