C# Class Open.Core.UI.Common.AnimationUtil

Provides utility functionality for working with animations.
Easing functions: - CircleEase, SineEase, BackEase - ExpoentialEase, PowerEase - QuadradicEase, CubicEase - QuarticEase, QuinticEase - ElasticEase, BounceEase
Exibir arquivo Open project: philcockfield/Open.TestHarness.SL

Public Methods

Method Description
CrossFade ( FrameworkElement from, FrameworkElement to, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void

Cross fades from one element to another.

Make sure the element you're fading to is at zero opacity before calling this method.

DoubleAnimate ( DependencyObject element, double fromValue, double toValue, double seconds, string propertyPath, IEasingFunction easing = null, System.Action callback = null ) : System.Windows.Media.Animation.DoubleAnimation

Animates the given element.

Fade ( DependencyObject element, double fromOpacity, double toOpacity, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void

Animates the opacity property on the given element.

Fade ( FrameworkElement element, bool fadeInOut, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void

Animates the opacity property on the given element.

FadeIn ( FrameworkElement element, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void

Fades the given element in from it's current opacity to 100% opacity.

FadeOut ( FrameworkElement element, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void

Fades the given element in from it's current opacity to 0% opacity.

Move ( DependencyObject element, Point start, Point end, double seconds, IEasingFunction easing = null, System.Action callback = null ) : MoveAnimation

Moves an element from one point to another.

Rotate ( FrameworkElement element, double toAngle, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void

Rotates an element.

Private Methods

Method Description
CreateDoubleAnimation ( double fromValue, double toValue, double seconds, IEasingFunction easing ) : System.Windows.Media.Animation.DoubleAnimation
CreateStoryboard ( DependencyObject element, Timeline animation, string propertyPath ) : System.Windows.Media.Animation.Storyboard
InsertAnimation ( System.Windows.Media.Animation.Storyboard storyboard, DependencyObject element, Timeline animation, string propertyPath ) : void
RegisterStoryboard ( System.Windows.Media.Animation.Storyboard storyboard ) : void

Method Details

CrossFade() public static method

Cross fades from one element to another.
Make sure the element you're fading to is at zero opacity before calling this method.
public static CrossFade ( FrameworkElement from, FrameworkElement to, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void
from System.Windows.FrameworkElement The element to fade from.
to System.Windows.FrameworkElement The element to fade to.
seconds double The duration in seconds.
easing IEasingFunction The easing function to apply to the animation (Null if not required).
callback System.Action Method to execute when the animation is complete.
return void

DoubleAnimate() public static method

Animates the given element.
public static DoubleAnimate ( DependencyObject element, double fromValue, double toValue, double seconds, string propertyPath, IEasingFunction easing = null, System.Action callback = null ) : System.Windows.Media.Animation.DoubleAnimation
element System.Windows.DependencyObject The element to animate.
fromValue double The starting property value.
toValue double Te ending property value.
seconds double The duration in seconds.
propertyPath string The path to the property to animate (eg. "Opacity" or "(Canvas.Left)").
easing IEasingFunction The easing function to apply to the animation (Null if not required).
callback System.Action Method to execute when the animation is complete.
return System.Windows.Media.Animation.DoubleAnimation

Fade() public static method

Animates the opacity property on the given element.
public static Fade ( DependencyObject element, double fromOpacity, double toOpacity, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void
element System.Windows.DependencyObject The element to animate.
fromOpacity double The starting opacity value (0-1).
toOpacity double The ending opacity value (0-1).
seconds double The duration in seconds.
easing IEasingFunction
callback System.Action Method to execute when the animation is complete.
return void

Fade() public static method

Animates the opacity property on the given element.
public static Fade ( FrameworkElement element, bool fadeInOut, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void
element System.Windows.FrameworkElement The element to animate.
fadeInOut bool Flag indicating if the element should be faded in (true) or out (false).
seconds double The duration in seconds.
easing IEasingFunction The easing function to apply to the animation (Null if not required).
callback System.Action Method to execute when the animation is complete.
return void

FadeIn() public static method

Fades the given element in from it's current opacity to 100% opacity.
public static FadeIn ( FrameworkElement element, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void
element System.Windows.FrameworkElement The element to animate.
seconds double The duration in seconds.
easing IEasingFunction The easing function to apply to the animation (Null if not required).
callback System.Action Method to execute when the animation is complete.
return void

FadeOut() public static method

Fades the given element in from it's current opacity to 0% opacity.
public static FadeOut ( FrameworkElement element, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void
element System.Windows.FrameworkElement The element to animate.
seconds double The duration in seconds.
easing IEasingFunction The easing function to apply to the animation (Null if not required).
callback System.Action Method to execute when the animation is complete.
return void

Move() public static method

Moves an element from one point to another.
public static Move ( DependencyObject element, Point start, Point end, double seconds, IEasingFunction easing = null, System.Action callback = null ) : MoveAnimation
element System.Windows.DependencyObject The element to animate.
start Point The X,Y coordinates for the start of the animation.
end Point The X,Y coordinates for the end of the animation.
seconds double The duration in seconds.
easing IEasingFunction The easing function to apply to the animation (Null if not required).
callback System.Action Method to execute when the animation is complete.
return MoveAnimation

Rotate() public static method

Rotates an element.
public static Rotate ( FrameworkElement element, double toAngle, double seconds, IEasingFunction easing = null, System.Action callback = null ) : void
element System.Windows.FrameworkElement The element to animate.
toAngle double The angle to rotate to.
seconds double The duration in seconds.
easing IEasingFunction The easing function to apply to the animation (Null if not required).
callback System.Action Method to execute when the animation is complete.
return void