{"record":{"id":"3a22f332b1b1a88b","repo":"stride3d/stride","slug":"the-parameter-of-this-converter-must-be-convertible-to-a","errorCode":null,"errorMessage":"The parameter of this converter must be convertible to a double.","messagePattern":"The parameter of this converter must be convertible to a double\\.","errorType":"exception","errorClass":"ArgumentException","httpStatus":null,"severity":"error","filePath":"sources/presentation/Stride.Core.Presentation.Wpf/ValueConverters/Multiply.cs","lineNumber":37,"sourceCode":"        {\n            double scalar;\n            try\n            {\n                scalar = ConverterHelper.ConvertToDouble(value, culture);\n            }\n            catch (Exception exception)\n            {\n                throw new ArgumentException(\"The value of this converter must be convertible to a double.\", exception);\n            }\n\n            double param;\n            try\n            {\n                param = ConverterHelper.ConvertToDouble(parameter, culture);\n            }\n            catch (Exception exception)\n            {\n                throw new ArgumentException(\"The parameter of this converter must be convertible to a double.\", exception);\n            }\n\n            return System.Convert.ChangeType(scalar * param, targetType);\n        }\n\n        /// <inheritdoc/>\n        public override object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)\n        {\n            double scalar;\n            try\n            {\n                scalar = ConverterHelper.ConvertToDouble(value, culture);\n            }\n            catch (Exception exception)\n            {\n                throw new ArgumentException(\"The value of this converter must be convertible to a double.\", exception);\n            }\n","sourceCodeStart":19,"sourceCodeEnd":55,"githubUrl":"https://github.com/stride3d/stride/blob/96fad776d210c221682aac1ccdf4c79dc046fc38/sources/presentation/Stride.Core.Presentation.Wpf/ValueConverters/Multiply.cs#L19-L55","documentation":"Multiply.Convert requires the converter parameter to be convertible to a double via ConverterHelper.ConvertToDouble. When the parameter is a non-numeric type or an unparsable string, the underlying exception is wrapped in an ArgumentException indicating the parameter is at fault.","triggerScenarios":"ConverterParameter set to a non-numeric string in XAML (e.g. ConverterParameter=\"scale\"), or a parameter object whose type ConvertToDouble cannot handle.","commonSituations":"Typos in XAML ConverterParameter (text where a number was intended); culture-sensitive decimal commas in XAML attributes; forgetting that ConverterParameter is a string in XAML.","solutions":["Set ConverterParameter to a valid numeric string, e.g. ConverterParameter=\"1.5\".","Use invariant decimal point format (.) in XAML parameters.","Pass the parameter programmatically as a double when constructing the binding in code."],"exampleFix":"<!-- before -->\n<Binding Converter=\"{StaticResource multiply}\" ConverterParameter=\"1,5\"/>\n<!-- after -->\n<Binding Converter=\"{StaticResource multiply}\" ConverterParameter=\"1.5\"/>","handlingStrategy":"validation","validationCode":"bool isValidParameter(object? p) => p is double || p is int || (p is string s && double.TryParse(s, NumberStyles.Any, CultureInfo.InvariantCulture, out _));","typeGuard":null,"tryCatchPattern":"try { result = multiply.Convert(value, targetType, parameter, culture); } catch (ArgumentException) { result = DependencyProperty.UnsetValue; }","preventionTips":["Always use invariant decimal point (.) in ConverterParameter strings","Quote numeric parameters in XAML to avoid culture surprises","Prefer code-created bindings with typed double parameters for dynamic values"],"tags":["wpf","value-converter","type-conversion","converter-parameter"],"backgroundTag":"invalid-argument-value","analyzedSha":"96fad776d210c221682aac1ccdf4c79dc046fc38","analyzedAt":"2026-09-14T02:59:31.279Z","contentChangedAt":"2026-09-14T02:59:31.279Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}