Minimal custom frame loop
AnimationControl
Build a custom Avalonia animation without rebuilding its lifecycle loop.
Explore source ↗Capability
A lightweight base control owns attachment, frame scheduling, delta time, invalidation, and rendering so custom animation logic only overrides the meaningful hooks.
- 01
Automatic frame loop
- 02
Delta-time update hook
- 03
Automatic visual invalidation
- 04
Small subclassing surface
How it composes
From intent
to working system.
Attach
The base observes visual-tree lifetime.
Tick
Frame callbacks receive current and previous time.
Update
The subclass advances only its domain state.
Draw
Normal Avalonia rendering presents each invalidated frame.
Quick start
Adopt this
capability.
Start with the primary module, then add the related packages only when the application needs those layers. Replace VERSION with the current NuGet version.
dotnet add package AnimationControl<PackageReference Include="AnimationControl" Version="VERSION" /><PackageVersion Include="AnimationControl" Version="VERSION" />public sealed class PulseControl : AnimationControl{ protected override void OnAnimationFrame(TimeSpan now, TimeSpan last) => Progress = (Progress + (now - last).TotalSeconds) % 1;
public override void Render(DrawingContext context) => DrawPulse(context, Progress);}Modules in this capability
Use one layer.
Compose the rest.
Source of truth
Read the module beside the complete system.
The implementation, samples, issues, and release notes stay in the parent repository so module details remain connected to the product architecture.