{"record":{"id":"69e9bdc3a2ec8933","repo":"AvaloniaUI/Avalonia","slug":"item-debugdisplay-must-have-a-value-of-type-typ","errorCode":null,"errorMessage":"{item.DebugDisplay} must have a value of type {typeof(TransformOperations)}.","messagePattern":"(.+?) must have a value of type (.+?)\\.","errorType":"validation","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Avalonia.Base/Animation/Animators/TransformOperationsAnimator.cs","lineNumber":32,"sourceCode":"\n        public override TransformOperations Interpolate(double progress, TransformOperations oldValue, TransformOperations newValue)\n        {\n            var oldTransform = EnsureOperations(oldValue);\n            var newTransform = EnsureOperations(newValue);\n\n            return TransformOperations.Interpolate(oldTransform, newTransform, progress);\n        }\n\n        internal static TransformOperations EnsureOperations(ITransform value)\n        {\n            return value as TransformOperations ?? TransformOperations.Identity;\n        }\n\n        void IAvaloniaListItemValidator<AnimatorKeyFrame>.Validate(AnimatorKeyFrame item)\n        {\n            if (item.Value is not TransformOperations)\n            {\n                throw new InvalidOperationException($\"{item.DebugDisplay} must have a value of type {typeof(TransformOperations)}.\");\n            }\n        }\n    }\n}\n","sourceCodeStart":14,"sourceCodeEnd":37,"githubUrl":"https://github.com/AvaloniaUI/Avalonia/blob/11c542726898ae954a1ef668c65ec79ec92ab17d/src/Avalonia.Base/Animation/Animators/TransformOperationsAnimator.cs#L14-L37","documentation":"Thrown by TransformOperationsAnimator's list validator (IAvaloniaListItemValidator<AnimatorKeyFrame>.Validate) when an added AnimatorKeyFrame's Value is not a TransformOperations instance. This animator exclusively interpolates TransformOperations, so any other value type in a key frame is rejected at insertion time.","triggerScenarios":"Adding an AnimatorKeyFrame whose Value is any type other than TransformOperations to a TransformOperationsAnimator's key frame collection (e.g. setting Value to a string, double, or a different ITransform).","commonSituations":"XAML key frame using a non-transform value or a raw Transform string instead of a TransformOperations; programmatic key frame with the wrong value type; confusing TransformAnimator with TransformOperationsAnimator.","solutions":["Set each key frame's Value to a TransformOperations instance.","Build TransformOperations via TransformOperations.Parse from a CSS-style transform string.","Use TransformAnimator instead if you need non-TransformOperations transform types."],"exampleFix":"// before\nkf.Value = \"translate(10px)\"; // string, not TransformOperations\n\n// after\nkf.Value = TransformOperations.Parse(\"translate(10px)\");","handlingStrategy":"type-guard","validationCode":"foreach (var kf in animator)\n    if (kf.Value is not TransformOperations)\n        throw new InvalidOperationException($\"KeyFrame value must be TransformOperations, got {kf.Value?.GetType()}.\");","typeGuard":"static bool ValueIsTransformOperations(AnimatorKeyFrame kf) => kf.Value is TransformOperations;","tryCatchPattern":null,"preventionTips":["Always set TransformOperationsAnimator key-frame Values to TransformOperations instances.","Use TransformOperations.Parse for CSS-style transform strings.","Pick TransformAnimator over TransformOperationsAnimator when the value type differs."],"tags":["animation","type-mismatch","transform","keyframe","avalonia"],"backgroundTag":null,"analyzedSha":"11c542726898ae954a1ef668c65ec79ec92ab17d","analyzedAt":"2026-08-13T11:57:40.261Z","schemaVersion":2},"datasetVersion":"2026-08-13T14:17:21.547Z"}