Table of Contents

Class NodeAppearAnimation

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

Combines fade and scale for a complete appear/disappear effect.

public class NodeAppearAnimation : IAnimation
Inheritance
NodeAppearAnimation
Implements
Inherited Members

Constructors

NodeAppearAnimation(Node, bool, double, Action<Node, double, double>?, Action?)

Creates a new node appear/disappear animation.

public NodeAppearAnimation(Node node, bool appearing, double duration = 0.3, Action<Node, double, double>? onUpdate = null, Action? onComplete = null)

Parameters

node Node

The node to animate.

appearing bool

True for appear animation, false for disappear.

duration double

Animation duration in seconds.

onUpdate Action<Node, double, double>

Callback with (node, opacity, scale).

onComplete Action

Callback when animation completes.

Properties

CurrentOpacity

Gets the current opacity value.

public double CurrentOpacity { get; }

Property Value

double

CurrentScale

Gets the current scale value.

public double CurrentScale { get; }

Property Value

double

IsComplete

Gets whether the animation has completed.

public bool IsComplete { get; }

Property Value

bool

Methods

Appear(Node, double, Action<Node, double, double>?, Action?)

Creates an appear animation for a node.

public static NodeAppearAnimation Appear(Node node, double duration = 0.3, Action<Node, double, double>? onUpdate = null, Action? onComplete = null)

Parameters

node Node
duration double
onUpdate Action<Node, double, double>
onComplete Action

Returns

NodeAppearAnimation

Cancel()

Called when the animation completes or is cancelled.

public void Cancel()

Disappear(Node, double, Action<Node, double, double>?, Action?)

Creates a disappear animation for a node.

public static NodeAppearAnimation Disappear(Node node, double duration = 0.2, Action<Node, double, double>? onUpdate = null, Action? onComplete = null)

Parameters

node Node
duration double
onUpdate Action<Node, double, double>
onComplete Action

Returns

NodeAppearAnimation

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.