{"record":{"id":"14d134fa21624cbd","repo":"dotnet/wpf","slug":"sr-timing-notextchildren","errorCode":null,"errorMessage":"SR.Timing_NoTextChildren","messagePattern":"SR\\.Timing_NoTextChildren","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/TimelineGroup.cs","lineNumber":203,"sourceCode":"        /// WritePreamble() or WritePostscript().  It also doesn't throw an\n        /// ArgumentNullException if the childText parameter is null.  These tasks\n        /// are performed by the interface implementation.  Therefore, it's OK\n        /// for a derived class to override this method and call the base\n        /// class implementation only if they determine that it's the right\n        /// course of action.  The derived class can rely on Timeline's\n        /// implementation of IAddChild.AddChild or implement their own\n        /// following the Freezable pattern since that would be a public\n        /// method.\n        /// </remarks>\n        /// <param name=\"childText\">A string representing the child text that\n        /// should be added.  If this is a Timeline an exception will be\n        /// thrown.</param>\n        /// <exception cref=\"InvalidOperationException\">Timelines have no way\n        /// of adding text.</exception>\n        [EditorBrowsable(EditorBrowsableState.Advanced)]\n        protected virtual void AddText(string childText)\n        {\n            throw new InvalidOperationException(SR.Timing_NoTextChildren);\n        }\n\n        #endregion // IAddChild interface\n    }\n}\n","sourceCodeStart":185,"sourceCodeEnd":209,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/TimelineGroup.cs#L185-L209","documentation":"TimelineGroup.AddText always throws InvalidOperationException because timelines cannot accept text content. Text nodes appearing inside a timeline element in XAML (e.g. whitespace or stray text under <Storyboard>) have no representation and are rejected.","triggerScenarios":"Calling AddText directly, or XAML parser encountering non-whitespace text content inside a Storyboard/ParallelTimeline element (often from stray characters or bad markup inside the storyboard).","commonSituations":"Accidental text/typo inside <Storyboard>...</Storyboard> in XAML; frameworks or tools generating XAML that inject text nodes into timeline containers.","solutions":["Remove any text content inside timeline elements in XAML","Ensure only child element tags (animations/timelines) appear inside Storyboard/ParallelTimeline","Check for invisible characters or malformed entity references inside the storyboard element"],"exampleFix":"// before\n<Storyboard>\n  Some stray text\n  <DoubleAnimation .../>\n</Storyboard>\n// after\n<Storyboard>\n  <DoubleAnimation .../>\n</Storyboard>","handlingStrategy":"validation","validationCode":"if (!string.IsNullOrWhiteSpace(childText)) throw new ArgumentException(\"Timelines accept no text content\");","typeGuard":null,"tryCatchPattern":"try { storyboard.AddText(text); }\ncatch (InvalidOperationException) { /* remove text content from timeline */ }","preventionTips":["Keep timeline XAML elements free of text nodes","Check for stray characters inside <Storyboard> blocks","Regenerate XAML from templates that guarantee element-only content"],"tags":["wpf","animation","xaml","unsupported-operation"],"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"}