{"record":{"id":"bf69074e24f4c45b","repo":"dotnet/wpf","slug":"sr-indexedpropdescnotimplemented","errorCode":null,"errorMessage":"SR.IndexedPropDescNotImplemented","messagePattern":"SR\\.IndexedPropDescNotImplemented","errorType":"exception","errorClass":"NotSupportedException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/PropertyPathWorker.cs","lineNumber":301,"sourceCode":"                                value = IListIndexOutOfRange;\n                            }\n                        }\n                        else\n                        {\n                            // normal case\n                            value = pi.GetValue(item,\n                                            BindingFlags.GetProperty, null,\n                                            args,\n                                            CultureInfo.InvariantCulture);\n                        }\n                    }\n                    else if ((dia = _arySVS[level].info as DynamicIndexerAccessor) != null)\n                    {\n                        value = dia.GetValue(item, _arySVS[level].args);\n                    }\n                    else\n                    {\n                        throw new NotSupportedException(SR.IndexedPropDescNotImplemented);\n                    }\n                    break;\n\n                case SourceValueType.Direct:\n                    value = item;\n                    break;\n            }\n\n            if (isExtendedTraceEnabled)\n            {\n                object accessor = _arySVS[level].info;\n                if (accessor == DependencyProperty.UnsetValue)\n                    accessor = null;\n\n                TraceData.TraceAndNotifyWithNoParameters(TraceEventType.Warning,\n                                    TraceData.GetValue(\n                                        TraceData.Identify(_host.ParentBindingExpression),\n                                        level,","sourceCodeStart":283,"sourceCodeEnd":319,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Data/PropertyPathWorker.cs#L283-L319","documentation":"PropertyPathWorker.GetValue only knows how to evaluate indexed path segments whose accessor is a DynamicIndexerAccessor; any other (non-WPF) implementation of IndexedPropDesc hits the NotSupportedException SR.IndexedPropDescNotImplemented. This means the path contains an indexer whose descriptor was not created through the expected internal accessor factory.","triggerScenarios":"Evaluating a binding/item-property path with an indexed segment (e.g. \"Items[3]\") where the indexed property descriptor is a custom IndexedPropDesc implementation rather than the internal DynamicIndexerAccessor — typically from custom binding engines, custom ICustomTypeDescriptor output, or internal reflection paths.","commonSituations":"Custom data-binding frameworks or tests plugging their own property-descriptor types into WPF path evaluation; unusual indexer descriptors produced by custom TypeDescriptionProviders on bound objects.","solutions":["Ensure the indexed segment is resolved through standard WPF binding (Binding/PropertyPath) so the internal DynamicIndexerAccessor is created, not a custom IndexedPropDesc.","For custom type descriptors, base indexer descriptions on the standard PropertyDescriptor/IndexerPropertyInfo mechanisms WPF expects.","Replace the indexed path segment with a direct CLR path (bind to an intermediate property exposing the value) to avoid indexer evaluation.","Catch NotSupportedException and fall back to evaluating the path manually via reflection."],"exampleFix":"// before\nvar binding = new Binding(\"CustomItems[0]Name\"); // custom descriptor -> NotSupportedException\n\n// after\nvar binding = new Binding(\"FirstItemName\"); // expose FirstItemName on the view-model","handlingStrategy":"fallback","validationCode":"// prefer plain CLR path segments over indexer segments on custom descriptors\nbool usesIndexer = binding.Path?.Path != null && binding.Path.Path.Contains('[');","typeGuard":null,"tryCatchPattern":"try { value = EvaluatePath(item, path); }\ncatch (NotSupportedException ex) when (ex.Message.Contains(\"IndexedPropDesc\"))\n{\n    value = EvaluateViaReflection(item, path); // manual fallback\n}","preventionTips":["Use standard WPF Binding/PropertyPath so indexers resolve to internal accessors.","Avoid custom IndexedPropDesc implementations in binding paths.","Expose indexed data via intermediate CLR properties on the view-model.","Avoid mixing custom TypeDescriptionProviders with indexed path segments."],"tags":["wpf","binding","property-path","indexer","notsupported"],"backgroundTag":"unsupported-operation","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"}