{"record":{"id":"770070698c7e0183","repo":"dotnet/wpf","slug":"sr-startnodemustbefixedpageproxy","errorCode":null,"errorMessage":"SR.StartNodeMustBeFixedPageProxy","messagePattern":"SR\\.StartNodeMustBeFixedPageProxy","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/FixedTextSelectionProcessor.cs","lineNumber":193,"sourceCode":"        /// that lies within start node\n        /// </summary>\n        /// <param name=\"selection\">the selection that is being processed. Must implement ITextRange</param>\n        /// <param name=\"startNode\">The FixedPageProxy object, representing one page of the document</param>\n        /// <returns>A list containing one FixedTextRange locator part</returns>\n        /// <exception cref=\"ArgumentNullException\">startNode or selection is null</exception>\n        /// <exception cref=\"ArgumentException\">selection is of the wrong type</exception>\n        public override IList<ContentLocatorPart>\n            GenerateLocatorParts(Object selection, DependencyObject startNode)\n        {\n            ArgumentNullException.ThrowIfNull(startNode);\n            ArgumentNullException.ThrowIfNull(selection);\n\n            CheckSelection(selection);\n\n            FixedPageProxy fp = startNode as FixedPageProxy;\n\n            if (fp == null)\n                throw new ArgumentException(SR.StartNodeMustBeFixedPageProxy, nameof(startNode));\n\n            ContentLocatorPart part = new ContentLocatorPart(FixedTextElementName);\n            if (fp.Segments.Count == 0)\n            {\n                part.NameValuePairs.Add(TextSelectionProcessor.CountAttribute, 1.ToString(NumberFormatInfo.InvariantInfo));\n                part.NameValuePairs.Add(TextSelectionProcessor.SegmentAttribute + 0.ToString(NumberFormatInfo.InvariantInfo), \",,,\");\n            }\n            else\n            {\n                part.NameValuePairs.Add(TextSelectionProcessor.CountAttribute, fp.Segments.Count.ToString(NumberFormatInfo.InvariantInfo));\n\n                for (int i = 0; i < fp.Segments.Count; i++)\n                {\n                    string value = \"\";\n                    if (!double.IsNaN(fp.Segments[i].Start.X))\n                    {\n                        value += fp.Segments[i].Start.X.ToString(NumberFormatInfo.InvariantInfo) + TextSelectionProcessor.Separator + fp.Segments[i].Start.Y.ToString(NumberFormatInfo.InvariantInfo);\n                    }","sourceCodeStart":175,"sourceCodeEnd":211,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/FixedTextSelectionProcessor.cs#L175-L211","documentation":"ArgumentException from FixedTextSelectionProcessor.GenerateLocatorParts: the startNode passed in is not a FixedPageProxy (the object representing one page of a fixed document), so the processor cannot derive page-relative locator parts from it.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/PresentationFramework/MS/Internal/Annotations/Anchoring/FixedTextSelectionProcessor.cs:193 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a FixedPageProxy obtained from GetSelectedNodes as the startNode","Check the node type before calling GenerateLocatorParts and route to the appropriate selection processor"],"exampleFix":null,"handlingStrategy":"type-guard","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"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"}