{"record":{"id":"251c594bfaf5693d","repo":"dotnet/wpf","slug":"timing-skiptofilldestinationindefinite","errorCode":"Timing_SkipToFillDestinationIndefinite","errorMessage":"SR.Timing_SkipToFillDestinationIndefinite (Timing_SkipToFillDestinationIndefinite)","messagePattern":"SR\\.Timing_SkipToFillDestinationIndefinite \\(Timing_SkipToFillDestinationIndefinite\\)","errorType":"exception","errorClass":"InvalidOperationException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Clock.cs","lineNumber":969,"sourceCode":"        }\n\n\n        /// <summary>\n        /// Internal helper. Schedules an end for some specified time in the future.\n        /// </summary>\n        internal void InternalSkipToFill()\n        {\n            Debug.Assert(IsRoot);\n            \n            TimeSpan? effectiveDuration;\n\n            effectiveDuration = ComputeEffectiveDuration();\n\n            // Throw an exception if the active period extends forever.\n            if (effectiveDuration == null)\n            {\n                // Can't seek to the end if the simple duration is not resolved\n                throw new InvalidOperationException(SR.Timing_SkipToFillDestinationIndefinite);\n            }\n\n            // Offset to the end; override preceding seek requests\n            IsInteractivelyStopped = false;\n            PendingInteractiveStop = false;\n            ResetNodesWithSlip();  // Reset sync tracking\n\n            RootBeginPending = false;\n            _rootData.PendingSeekDestination = effectiveDuration.Value;  // Seek to the end time\n\n            NotifyNewEarliestFutureActivity();\n        }\n\n\n        /// <summary>\n        /// Internal helper for moving to new API. Removes a timeline from its active or fill period.\n        /// Timeline can be restarted with an interactive Begin call.\n        /// </summary>","sourceCodeStart":951,"sourceCodeEnd":987,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/PresentationCore/System/Windows/Media/Animation/Clock.cs#L951-L987","documentation":"InternalSkipToFill asks the clock to jump to its fill state at the end of its active period. If the clock's effective duration cannot be resolved (indefinite, e.g. Duration=Forever or unresolved), there is no end to seek to, so WPF throws InvalidOperationException with Timing_SkipToFillDestinationIndefinite. The library refuses to fill a timeline that never ends.","triggerScenarios":"Calling SkipToFill() on a clock/timeline whose effective duration is null — e.g. a Timeline with Duration=\"Forever\", or a ParallelTimeline whose children make the effective duration unresolvable. Also reached indirectly from ClockController and Begin methods that call InternalSkipToFill.","commonSituations":"Developers set RepeatBehavior=\"Forever\" or Duration=\"Forever\" on an animation/storyboard and then call SkipToFill to snap the visual to its end state; or they resolve a storyboard dynamically and the duration hasn't been resolved yet at seek time.","solutions":["Give the timeline a concrete Duration (TimeSpan) so a fill destination exists","Replace SkipToFill with Seek(ResolvedDuration, TimeSeekOrigin.Duration) only after verifying duration.HasTimeSpan","If the intent is 'hold last frame', set FillBehavior.HoldEnd and stop/pause the clock instead of skipping to fill","Guard with timeline.GetNaturalDuration(clock) or ComputeEffectiveDuration before calling"],"exampleFix":"// before\nmyAnimation.Duration = Duration.Forever;\nclock.Controller.SkipToFill(); // throws\n// after\nmyAnimation.Duration = new Duration(TimeSpan.FromSeconds(5));\nclock.Controller.SkipToFill();","handlingStrategy":"validation","validationCode":"var dur = timeline.Duration;\nbool canSkipToFill = dur.HasTimeSpan || timeline.RepeatBehavior.HasDuration;\nif (!canSkipToFill) throw new InvalidOperationException(\"Timeline has indefinite duration; SkipToFill is invalid.\");","typeGuard":null,"tryCatchPattern":"try { clock.Controller.SkipToFill(); }\ncatch (InvalidOperationException ex) when (ex.Message.Contains(\"SkipToFill\") || ex.Message.Contains(\"indefinite\")) { /* fall back to Seek with Begin origin or stop clock */ }","preventionTips":["Always set an explicit TimeSpan Duration on timelines you intend to SkipToFill","Prefer FillBehavior.HoldEnd plus Pause/Stop for 'hold last frame' behavior","Check duration.HasTimeSpan before any duration-relative clock operation"],"tags":["wpf","animation","clock","invalid-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"}