{"record":{"id":"656cbeecf877e87d","repo":"dotnet/wpf","slug":"storyboard-propertypathmustpointtodependencyproperty","errorCode":"Storyboard_PropertyPathMustPointToDependencyProperty","errorMessage":"SR.Format(SR.Storyboard_PropertyPathMustPointToDependencyProperty, currentPropertyPath.Path)","messagePattern":"SR\\.Format\\(SR\\.Storyboard_PropertyPathMustPointToDependencyProperty, currentPropertyPath\\.Path\\)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Media/Animation/Storyboard.cs","lineNumber":476,"sourceCode":"            // are handled differently.\n            using(currentPropertyPath.SetContext(targetObject))\n            {\n                if( currentPropertyPath.Length < 1 )\n                {\n                    throw new InvalidOperationException(SR.Storyboard_PropertyPathEmpty);\n                }\n\n                VerifyPathIsAnimatable(currentPropertyPath);\n\n                if( currentPropertyPath.Length == 1 )\n                {\n                    // We have a simple single-step property.\n                    targetProperty = currentPropertyPath.GetAccessor(0) as DependencyProperty;\n\n                    if( targetProperty == null )\n                    {\n                        // Unfortunately it's not a DependencyProperty.\n                        throw new InvalidOperationException(SR.Format(SR.Storyboard_PropertyPathMustPointToDependencyProperty, currentPropertyPath.Path ));\n                    }\n\n                    VerifyAnimationIsValid(targetProperty, animationClock);\n\n                    ObjectPropertyPair animatedTarget = new ObjectPropertyPair(targetObject, targetProperty);\n                    UpdateMappings(clockMappings, animatedTarget, animationClock);\n                }\n                else // path.Length > 1\n                {\n                    // This is a multi-step property path that requires more extensive\n                    //  setup.\n                    ProcessComplexPath(clockMappings, targetObject, currentPropertyPath, animationClock, handoffBehavior, layer);\n                }\n            }\n        }\n        else if ( currentClock is MediaClock ) // Not an animation clock - maybe a media clock?\n        {\n            // Yes it's a media clock.  Try to find the corresponding object and","sourceCodeStart":458,"sourceCodeEnd":494,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/System/Windows/Media/Animation/Storyboard.cs#L458-L494","documentation":"The first segment of the timeline's PropertyPath did not resolve to a DependencyProperty: PropertyPath.GetAccessor(0) returned something else (e.g. PropertyInfo/MethodInfo). WPF storyboards can only animate dependency properties, so ClockTreeWalkRecursive throws an InvalidOperationException including the offending path string.","triggerScenarios":"Storyboard.TargetProperty references a plain CLR property that is not a DP, or the path's first accessor is not a DependencyProperty (mis-qualified names, unsupported path syntax in storyboard context).","commonSituations":"Animating ordinary .NET properties on non-DependencyObject classes; typos in attached-property syntax such as writing Canvas.Left without parentheses; wrong casing causing the path parser to bind a non-DP member.","solutions":["Point TargetProperty at a real DependencyProperty, e.g. Storyboard.TargetProperty=\"Opacity\" or \"(Canvas.Left)\".","Use correct parenthesis syntax for attached/complex paths: \"(Panel.Background).(SolidColorBrush.Color)\".","If the property is not a DP, animate an equivalent DP or make the class a DependencyObject with a DependencyProperty."],"exampleFix":"<!-- before: plain CLR property -->\n<DoubleAnimation Storyboard.TargetName=\"shape\" Storyboard.TargetProperty=\"AngleDegrees\" .../>\n\n<!-- after: DependencyProperty path -->\n<DoubleAnimation Storyboard.TargetName=\"shape\" Storyboard.TargetProperty=\"(RotateTransform.Angle)\" .../>","handlingStrategy":"type-guard","validationCode":"var accessor = Storyboard.GetTargetProperty(anim)?.GetAccessor(0) as DependencyProperty;\nif (accessor == null)\n    throw new InvalidOperationException(\"First path segment is not a DependencyProperty\");","typeGuard":"bool FirstSegmentIsDependencyProperty(PropertyPath pp) => pp?.GetAccessor(0) is DependencyProperty;","tryCatchPattern":"try { sb.Begin(fe); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"DependencyProperty\")) {\n    // fix: point the path at a DependencyProperty\n}","preventionTips":["Animate only DependencyProperties.","Use parenthesis syntax for attached/complex paths: (Panel.Background).(SolidColorBrush.Color).","If the source property is a plain CLR property, add a DP or animate an equivalent DP."],"tags":["wpf","storyboard","dependency-property","propertypath"],"backgroundTag":"type-mismatch","analyzedSha":"81131a70a4c573cd62748a5c36908fc4d662daa9","analyzedAt":"2026-09-14T10:12:48.479Z","contentChangedAt":"2026-09-14T10:12:48.479Z","schemaVersion":2},"datasetVersion":"2026-09-21T21:30:21.729Z"}