Table of Contents

Class EdgeFlowAnimation

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

Animates an edge's stroke dash offset for a "flow" effect.

public class EdgeFlowAnimation : IAnimation
Inheritance
EdgeFlowAnimation
Implements
Inherited Members

Constructors

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

Creates a new edge flow animation.

public EdgeFlowAnimation(Edge edge, double speed = 50, Action<Edge, double>? onUpdate = null, double? maxDuration = null)

Parameters

edge Edge

The edge to animate.

speed double

Speed of the flow animation (pixels per second). Positive = forward (source to target), negative = reverse.

onUpdate Action<Edge, double>

Callback called each frame with the edge and current dash offset.

maxDuration double?

Maximum duration in seconds, or null for infinite.

EdgeFlowAnimation(Edge, double, bool, Action<Edge, double>?, double?)

Creates a new edge flow animation with explicit direction control.

public EdgeFlowAnimation(Edge edge, double speed, bool reverse, Action<Edge, double>? onUpdate = null, double? maxDuration = null)

Parameters

edge Edge

The edge to animate.

speed double

Speed of the flow animation (pixels per second, always positive).

reverse bool

If true, flow goes from target to source. If false, flow goes from source to target.

onUpdate Action<Edge, double>

Callback called each frame with the edge and current dash offset.

maxDuration double?

Maximum duration in seconds, or null for infinite.

Properties

CurrentDashOffset

Gets the current dash offset value.

public double CurrentDashOffset { 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()

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.