{"record":{"id":"4a418538f3d55c65","repo":"dotnet/wpf","slug":"microsoft-windows-controls-sr-format-microsoft-windows-4a4185","errorCode":null,"errorMessage":"Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidCtorParameterNoInfinityForStarSize, \"value\")","messagePattern":"Microsoft\\.Windows\\.Controls\\.SR\\.Format\\(Microsoft\\.Windows\\.Controls\\.SR\\.InvalidCtorParameterNoInfinityForStarSize, \"value\"\\)","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"src/Microsoft.DotNet.Wpf/src/System.Windows.Controls.Ribbon/Microsoft/Windows/Controls/Ribbon/RibbonControlLength.cs","lineNumber":55,"sourceCode":"        public RibbonControlLength(double pixels)\n            : this(pixels, RibbonControlLengthUnitType.Pixel)\n        {\n        }\n\n        /// <summary>\n        ///   Constructor, initializes the RibbonControlLength and specifies what kind of value \n        ///   it will hold.\n        /// </summary>\n        public RibbonControlLength(double value, RibbonControlLengthUnitType type)\n        {\n            if (double.IsNaN(value))\n            {\n                throw new ArgumentException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidCtorParameterNoNaN, \"value\"));\n            }\n\n            if (type == RibbonControlLengthUnitType.Star && double.IsInfinity(value))\n            {\n                throw new ArgumentException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidCtorParameterNoInfinityForStarSize, \"value\"));\n            }\n\n            if (type != RibbonControlLengthUnitType.Auto\n                && type != RibbonControlLengthUnitType.Pixel\n                && type != RibbonControlLengthUnitType.Item\n                && type != RibbonControlLengthUnitType.Star)\n            {\n                throw new ArgumentException(Microsoft.Windows.Controls.SR.Format(Microsoft.Windows.Controls.SR.InvalidCtorParameterUnknownRibbonControlLengthUnitType, \"type\"));\n            }\n\n            _unitValue = (type == RibbonControlLengthUnitType.Auto) ? 0.0 : value;\n            _unitType = type;\n        }\n\n        #endregion\n\n        #region Public Methods\n","sourceCodeStart":37,"sourceCodeEnd":73,"githubUrl":"https://github.com/dotnet/wpf/blob/81131a70a4c573cd62748a5c36908fc4d662daa9/src/Microsoft.DotNet.Wpf/src/System.Windows.Controls.Ribbon/Microsoft/Windows/Controls/Ribbon/RibbonControlLength.cs#L37-L73","documentation":"The RibbonControlLength(value, type) constructor throws this ArgumentException when type is Star and value is PositiveInfinity or NegativeInfinity. Star sizing weights must be finite; infinity is not a valid star value, so the constructor rejects it at construction time.","triggerScenarios":"Thrown at src/Microsoft.DotNet.Wpf/src/System.Windows.Controls.Ribbon/Microsoft/Windows/Controls/Ribbon/RibbonControlLength.cs:55 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Pass a finite double (not double.PositiveInfinity/NegativeInfinity) when constructing a RibbonControlLength with Star sizing","Use RibbonControlLength.Auto or a Pixel value if a special size is needed","Validate/clamp the value before constructing"],"exampleFix":null,"handlingStrategy":"validation","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"}