Uno: CornerRadius bug

Created on 16 Jun 2020  路  7Comments  路  Source: unoplatform/uno

Current behavior

Any XAML file that has CornerRadius="x x x x" and doesn't use commas, the g.cs file generated doesn't add them to the C# code, causing compile errors.
Annotation 2020-06-16 142839


This does not manifest when building UWP. It happens with Droid and WASM. I am unable to test with iOS or macOS at this time.

Expected behavior

How to reproduce it (as minimally and precisely as possible)

In a XAML view, create a Grid with the property:
<Grid CornerRadius="0 40 40 0" /> No commas separating.
Then build Droid or WASM.

Environment

Nuget Package:
lastest preview since 6/15/2020
Package Version(s):
lastest preview since 6/15/2020

Affected platform(s):

  • [ ] iOS
  • [x] Android
  • [x] WebAssembly
  • [ ] WebAssembly renderers for Xamarin.Forms
  • [ ] macOS
  • [ ] Windows
  • [ ] Build tasks
  • [ ] Solution Templates

Visual Studio:

  • [ ] 2017 (version: )
  • [x] 2019 (version: 16.6.2)
  • [ ] for Mac (version: )

Relevant plugins:

  • [ ] Resharper (version: )

Anything else we need to know?

arecode-generation kinbug projecshapes-brushes

All 7 comments

Had no idea this was possible :-D ! It actually works with Thickness too in UWP.

@jeromelaban I fixed it for CornerRadius in XamlFileGenerator as that is not Thickness and it previously just put the same string in the constructor. I haven't updated it in the converter class however. ThicknessConverter does not have support for spaces yet, should it be added there too?

@MartinZikmund I actually tried to fix it yesterday using Gitpod, I just made a BuildCorderRadius method similar to the BuildThickness one. But I couldn't figure out how to send a PR. I'll try and read up on how to contribute here in the future.

@seanocali sorry, didn't know you wanted to fix it yourself 馃槉. It surprised me spaces are supported in UWP so I implemented it as part of the investigation.

For contributions, I recommend forking the repo, creating a branch and you can then make pull request from your fork. I wrote three articles on contributing to Uno on my blog, maybe some of it could be useful 馃憤

@MartinZikmund indeed, the converter does not have support for spaces, and that may be useful when bindings or template bindings are involved.

@MartinZikmund indeed, the converter does not have support for spaces, and that may be useful when bindings or template bindings are involved.

I will add spaces support for Thickness and CornerRadius in the converter too

Was this page helpful?
0 / 5 - 0 ratings