{"record":{"id":"78ea123c1d461f61","repo":"dotnet/wpf","slug":"sr-animation-invalid-defaultvalue-destination-0-value-2-78ea12","errorCode":null,"errorMessage":"SR.Animation_Invalid_DefaultValue (destination: {0}, value: {2})","messagePattern":"SR\\.Animation_Invalid_DefaultValue \\(destination: (.+?), value: (.+?)\\)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/Int64Animation.cs","lineNumber":324,"sourceCode":"\n                    break;\n            }\n\n            if (validateOrigin \n                && !AnimatedTypeHelpers.IsValidAnimationValueInt64(defaultOriginValue))\n            {\n                throw new InvalidOperationException(\n                    SR.Format(\n                        SR.Animation_Invalid_DefaultValue,\n                        this.GetType(),\n                        \"origin\",\n                        defaultOriginValue.ToString(CultureInfo.InvariantCulture)));\n            }\n\n            if (validateDestination \n                && !AnimatedTypeHelpers.IsValidAnimationValueInt64(defaultDestinationValue))\n            {\n                throw new InvalidOperationException(\n                    SR.Format(\n                        SR.Animation_Invalid_DefaultValue,\n                        this.GetType(),\n                        \"destination\",\n                        defaultDestinationValue.ToString(CultureInfo.InvariantCulture)));\n            }\n\n\n            if (IsCumulative)\n            {\n                double currentRepeat = (double)(animationClock.CurrentIteration - 1);\n\n                if (currentRepeat > 0.0)\n                {\n                    Int64 accumulator = AnimatedTypeHelpers.SubtractInt64(to, from);\n\n                    accumulated = AnimatedTypeHelpers.ScaleInt64(accumulator, currentRepeat);\n                }","sourceCodeStart":306,"sourceCodeEnd":342,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Generated/Int64Animation.cs#L306-L342","documentation":"Int64Animation.GetCurrentValueCore throws this InvalidOperationException when the default destination value is not a valid Int64 animation value, per AnimatedTypeHelpers.IsValidAnimationValueInt64. This mirrors the origin check but validates the value the animation animates toward.","triggerScenarios":"Running an Int64Animation whose destination (To unset) resolves to an invalid default value; calling GetCurrentValueCore with an invalid defaultDestinationValue.","commonSituations":"Animations attached to properties with unset/invalid base values; misuse in custom clocks or composition scenarios.","solutions":["Set an explicit To (and From) on the Int64Animation.","Verify the target property's base value is a valid Int64 at animation start.","Ensure the animation targets an Int64-typed property.","Pass valid defaultDestinationValue when invoking the clock manually."],"exampleFix":"// before\nvar anim = new Int64Animation { From = 0 };\n// after\nvar anim = new Int64Animation { From = 0, To = 100, Duration = Duration.FromSeconds(1) };","handlingStrategy":"validation","validationCode":"if (!AnimatedTypeHelpers.IsValidAnimationValueInt64(defaultDestinationValue))\n    throw new InvalidOperationException(\"destination value is not a valid Int64 animation value\");","typeGuard":"bool IsValidInt64Value(object v) => v is long l && AnimatedTypeHelpers.IsValidAnimationValueInt64(l);","tryCatchPattern":"try { target.BeginAnimation(prop, longAnimation); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"destination\")) {\n    // restart with an explicit To value\n}","preventionTips":["Always set To (and From) when using Int64Animation on possibly-unset properties","Animate only Int64-typed dependency properties","Validate base values before composition-based animations"],"tags":["wpf","animation","invalid-value"],"backgroundTag":"invalid-argument-value","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-22T01:17:13.364Z"}