AvaloniaUI/Avalonia · error · InvalidOperationException
No animator registered for the property {setter.Property}. A
Error message
No animator registered for the property {setter.Property}. Add an animator to the Animation.Animators collection that matches this property to animate it. What it means
Thrown during Animation.InterpretKeyframes when no animator handler can be found for the property targeted by a Setter. Avalonia first checks Animation.Animators (GetAnimator) and then the global registry (GetAnimatorType) keyed by the property's type; if neither yields a handler, the property cannot be animated and the exception is raised.
Source
Thrown at src/Avalonia.Base/Animation/Animation.cs:241
var animatesVisibility = false;
foreach (var keyframe in Children)
{
foreach (var setter in keyframe.Setters)
{
if (setter.Property is null)
{
throw new InvalidOperationException("No Setter property assigned.");
}
if (setter.Property == Visual.IsVisibleProperty)
animatesVisibility = true;
var handler = Animation.GetAnimator(setter) ?? GetAnimatorType(setter.Property);
if (handler == null)
{
throw new InvalidOperationException($"No animator registered for the property {setter.Property}. Add an animator to the Animation.Animators collection that matches this property to animate it.");
}
var (type, factory) = handler.Value;
if (!handlerList.ContainsKey((type, setter.Property)))
handlerList[(type, setter.Property)] = factory;
var cue = keyframe.Cue;
if (keyframe.TimingMode == KeyFrameTimingMode.TimeSpan)
{
cue = new Cue(keyframe.KeyTime.TotalSeconds / Duration.TotalSeconds);
}
var newKF = new AnimatorKeyFrame(type, factory, cue, keyframe.KeySpline);
subscriptions.Add(newKF.BindSetter(setter, control));
View on GitHub (pinned to 11c5427268)
Solutions
- Register a custom animator for the property type via Animation.Animators.Add(...) or the global registry before using it in an animation.
- Confirm the property you are animating is one Avalonia supports out of the box (double, float, Color, Thickness, CornerRadius, Matrix, Vector, Point, Size, etc.).
- If animating a custom property, provide an IAnimator implementation matching (typeof(propertyOwner), Property).
- Check for typos in the Property reference; an unknown property yields no animator.
Example fix
// before // animating MyControl.MyCustomStructProperty with no registered animator <Setter Property="MyCustomStructProperty" Value="..."/> // after — register an animator for the property type Animation.Animators.AddAnimator<MyStruct>((owner, prop) => new MyStructAnimator(owner, prop));
Defensive patterns
Strategy: validation
Validate before calling
// confirm an animator exists for the property before running the animation
foreach (var kf in animation.Children)
foreach (var s in kf.Setters)
if (Animation.GetAnimator(s) is null && GetAnimatorType(s.Property) is null)
throw new InvalidOperationException($"No animator for {s.Property} — register one."); Type guard
static bool AllPropertiesHaveAnimator(Animation a)
=> a.Children.SelectMany(k => k.Setters).All(s => Animation.GetAnimator(s) is not null || GetAnimatorType(s.Property) is not null); Prevention
- Register custom animators for custom property types via Animation.Animators before animating.
- Animate only supported types unless you provide an IAnimator.
- Verify the Property reference is valid (typos yield no animator).
- Keep the animator registry configured before any animation runs.
When it happens
Trigger: Animating a property whose type has no registered animator: either the property type isn't in the default animator registry, or a custom property was used without registering a matching animator. Also hit when animating a non-animatable property or one whose registered handler was removed.
Common situations: Animating custom AvaloniaProperty instances of types not covered by built-in animators (e.g. complex structs, custom enums); using a third-party control property that wasn't registered for animation; misconfigured Animation.Animators; animating properties that are conceptually non-numeric without a custom interpolator.
Related errors
- Transitions collection cannot be reset.
- Animator has no property specified.
- Transition elements have different parents.
- No Setter property assigned.
- Unknown PlaybackBehavior value: {_playbackBehavior}
AI-assisted analysis of AvaloniaUI/Avalonia@11c5427268 (2026-08-13).
Data as JSON: /api/errors/f575936810fc6894.
Report an issue: GitHub.