Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ConstrainedBox crashes with all cultures not using '.' as the decimal separator #4252

Closed
5 of 20 tasks
rudyhuyn opened this issue Sep 16, 2021 · 1 comment · Fixed by #4253
Closed
5 of 20 tasks

ConstrainedBox crashes with all cultures not using '.' as the decimal separator #4252

rudyhuyn opened this issue Sep 16, 2021 · 1 comment · Fixed by #4253
Assignees
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 priority 🚩
Milestone

Comments

@rudyhuyn
Copy link
Contributor

rudyhuyn commented Sep 16, 2021

Describe the bug

ConstrainedBox crashes with all cultures not using '.' as the decimal separator.

Reason

ConvertToAspectRatio in AspectRatio uses Convert.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);

  • Is this bug a regression in the toolkit? If so, what toolkit version did you last see it work:

Steps to Reproduce

Steps to reproduce the behavior:

  1. Switch the region to France or Italy and set Regional Format to France, Italy or Recommended
  2. Launch a test app with a ConstrainedBox control
  3. See crash

Expected behavior

Not crash :)

Screenshots

MicrosoftTeams-image

Environment

NuGet Package(s): 7.1.0-rc1

Package Version(s):

Windows 10 Build Number:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build (won't disclosure)

App min and target version:

  • Fall Creators Update (16299)
  • April 2018 Update (17134)
  • October 2018 Update (17763)
  • May 2019 Update (18362)
  • May 2020 Update (19041)
  • Insider Build (won't disclosure)

Device form factor:

  • Desktop
  • Xbox
  • Surface Hub
  • IoT

Visual Studio version:

  • 2017 (15.{minor_version})
  • 2019 (16.{minor_version})
  • 2022 (17.{minor_version})
@rudyhuyn rudyhuyn added the bug 🐛 An unexpected issue that highlights incorrect behavior label Sep 16, 2021
@ghost ghost added the needs triage 🔍 label Sep 16, 2021
@ghost
Copy link

ghost commented Sep 16, 2021

Hello rudyhuyn, thank you for opening an issue with us!

I have automatically added a "needs triage" label to help get things started. Our team will analyze and investigate the issue, and escalate it to the relevant team if possible. Other community members may also look into the issue and provide feedback 🙌

@Sergio0694 Sergio0694 self-assigned this Sep 16, 2021
@Sergio0694 Sergio0694 added this to the 7.1 milestone Sep 16, 2021
@ghost ghost added the In-PR 🚀 label Sep 16, 2021
@ghost ghost modified the milestone: 7.1 Sep 16, 2021
@ghost ghost added Completed 🔥 and removed In-PR 🚀 labels Sep 16, 2021
@ghost ghost locked as resolved and limited conversation to collaborators Nov 15, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug 🐛 An unexpected issue that highlights incorrect behavior Completed 🔥 priority 🚩
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants