ConstrainedBox crashes with all cultures not using '.' as the decimal separator #4252
Closed
5 of 20 tasks
Labels
Milestone
Describe the bug
ConstrainedBox
crashes with all cultures not using '.' as the decimal separator.Reason
ConvertToAspectRatio
inAspectRatio
usesConvert.ToDouble
which is region/culture-sensitive.The method will crash if you try to parse "1.666" if the region is France, Italy or other regions not using '.' as the decimal separator.
Instead, the method should use:
double value = double.Parse(number, NumberStyles.AllowDecimalPoint, CultureInfo.CurrentCulture);
Steps to Reproduce
Steps to reproduce the behavior:
Regional Format
to France, Italy or RecommendedConstrainedBox
controlExpected behavior
Not crash :)
Screenshots
Environment
NuGet Package(s): 7.1.0-rc1
Package Version(s):
Windows 10 Build Number:
App min and target version:
Device form factor:
Visual Studio version:
The text was updated successfully, but these errors were encountered: