Table of Contents

Class EdgeFadeAnimation

Namespace
FlowGraph.Avalonia.Animation
Assembly
FlowGraph.Avalonia.dll

Animates an edge's opacity for fade in/out effects.

public class EdgeFadeAnimation : IAnimation
Inheritance
EdgeFadeAnimation
Implements
Inherited Members

Constructors

EdgeFadeAnimation(Edge, double, double, double, Func<double, double>?, Action<Edge, double>?, Action?)

Creates a new edge fade animation.

public EdgeFadeAnimation(Edge edge, double startOpacity, double endOpacity, double duration = 0.3, Func<double, double>? easing = null, Action<Edge, double>? onUpdate = null, Action? onComplete = null)

Parameters

edge Edge

The edge to animate.

startOpacity double

Starting opacity (0-1).

endOpacity double

Ending opacity (0-1).

duration double

Animation duration in seconds.

easing Func<double, double>

Easing function (defaults to EaseOutCubic).

onUpdate Action<Edge, double>

Callback called each frame with the edge and current opacity.

onComplete Action

Callback when animation completes.

Properties

CurrentOpacity

Gets the current opacity value.

public double CurrentOpacity { get; }

Property Value

double

IsComplete

Gets whether the animation has completed.

public bool IsComplete { get; }

Property Value

bool

Methods

Cancel()

Called when the animation completes or is cancelled.

public void Cancel()

FadeIn(Edge, double, Action<Edge, double>?, Action?)

Creates a fade-in animation for an edge.

public static EdgeFadeAnimation FadeIn(Edge edge, double duration = 0.3, Action<Edge, double>? onUpdate = null, Action? onComplete = null)

Parameters

edge Edge
duration double
onUpdate Action<Edge, double>
onComplete Action

Returns

EdgeFadeAnimation

FadeOut(Edge, double, Action<Edge, double>?, Action?)

Creates a fade-out animation for an edge.

public static EdgeFadeAnimation FadeOut(Edge edge, double duration = 0.3, Action<Edge, double>? onUpdate = null, Action? onComplete = null)

Parameters

edge Edge
duration double
onUpdate Action<Edge, double>
onComplete Action

Returns

EdgeFadeAnimation

Update(double)

Updates the animation with the elapsed time since the last frame.

public void Update(double deltaTime)

Parameters

deltaTime double

Time elapsed since last update in seconds.