-
Notifications
You must be signed in to change notification settings - Fork 16
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
Layout Serialization is causing problems due to regional formatting #6
Comments
Sorry Karmoq, it took me some time to reply to you. In the USA, commas are not used for the decimals - only for separation of thousands, Please use period - '.' for the decimals:) |
Hey Nick, |
Yes, you are correct. Actually it is a problem with Avalonia's GridLength - they provide local ToString, but locale-invariant parse, but I can fix it and I will |
please, download the next version of UniDock - https://www.nuget.org/packages/NP.Avalonia.UniDock/1.0.37 It should be working. |
Hey Nick,
I'm having an issue with the serialization of layouts, and I believe it is related to regional formatting.
My colleague has czech regional formatting, which uses commas (",") for separating decimal numbers, instead of the usual decimal points (".")
After looking at the serialization, it seems like that when saving the layouts, it uses the GridLength.ToString() method to convert it to strings, which is not culture-invariant. See
DockGroupParams.ToGroupParams(this IDockGroup dg)
, line 149.But when loading the layouts, it uses the
GridLength.Parse
method, which, when looking at the Avalonia Source code, correctly uses Invariant Culture for parsing.In some cases this results in commas being ignored when loading a saved layout:
Before saving
After saving
I believe this can be fixed by changing the non-culture-invariant call to
GridLength.ToString()
to something likeGridLength.Value.ToString(CultureInfo.Invariant)
(of course considering the star etc)I hope it is clear what I'm explaining :)
Thanks,
Karmoq
The text was updated successfully, but these errors were encountered: