{"record":{"id":"398a922809c0352a","repo":"HandyOrg/HandyControl","slug":"index","errorCode":null,"errorMessage":"index","messagePattern":"index","errorType":"exception","errorClass":"ArgumentOutOfRangeException","httpStatus":null,"severity":"error","filePath":"src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeTrack.cs","lineNumber":180,"sourceCode":"        set => SetValue(ValueEndProperty, value);\n    }\n\n    public static readonly DependencyProperty IsDirectionReversedProperty = DependencyProperty.Register(\n        nameof(IsDirectionReversed), typeof(bool), typeof(RangeTrack), new PropertyMetadata(ValueBoxes.FalseBox));\n\n    public bool IsDirectionReversed\n    {\n        get => (bool) GetValue(IsDirectionReversedProperty);\n        set => SetValue(IsDirectionReversedProperty, ValueBoxes.BooleanBox(value));\n    }\n\n    protected override Visual GetVisualChild(int index)\n    {\n        if (_visualChildren?[index] == null)\n        {\n            // ReSharper disable once UseNameofExpression\n            // ReSharper disable once LocalizableElement\n            throw new ArgumentOutOfRangeException(\"index\", index, \"ArgumentOutOfRange\");\n        }\n        return _visualChildren[index];\n    }\n\n    protected override Size MeasureOverride(Size availableSize)\n    {\n        var desiredSize = new Size();\n\n        // Only measure thumb\n        // Repeat buttons will be sized based on thumb\n        if (_thumbStart != null)\n        {\n            _thumbStart.Measure(availableSize);\n            desiredSize = _thumbStart.DesiredSize;\n        }\n\n        if (_thumbEnd != null)\n        {","sourceCodeStart":162,"sourceCodeEnd":198,"githubUrl":"https://github.com/HandyOrg/HandyControl/blob/2c0875ebd67326e0c67282967e3e809c69282fee/src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeTrack.cs#L162-L198","documentation":"Argument guard in RangeTrack.GetVisualChild: throws (ArgumentOutOfRangeException, message 'index') when the requested visual child index is outside the _visualChildren array range or the array is null/has no child at that index. WPF's visual tree calls this with an index derived from VisualChildrenCount, so it fires when the reported count and the actual _visualChildren contents are out of sync.","triggerScenarios":"Thrown at src/Shared/HandyControl_Shared/Controls/Slider/RangeSlider/RangeTrack.cs:180 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Ensure VisualChildrenCount always matches the number of non-null entries actually stored in _visualChildren","Rebuild _visualChildren (AddVisualChild/RemoveVisualChild) whenever thumb or button parts are added, removed or hidden","Bounds-check index against VisualChildrenCount before indexing and return/throw base behavior for invalid indices"],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"2c0875ebd67326e0c67282967e3e809c69282fee","analyzedAt":"2026-09-14T14:45:29.754Z","contentChangedAt":"2026-09-14T14:45:29.754Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}