Bug 60787 - Frames with border radius preset have this radius reset when their backcolor is changed
Summary: Frames with border radius preset have this radius reset when their backcolor ...
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.5.0
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2017-11-21 12:31 UTC by drew.robey
Modified: 2018-05-16 16:37 UTC (History)
4 users (show)

Is this bug a regression?: No
Last known good build:

Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.

Please create a new report for Bug 60787 on Developer Community or GitHub if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: Developer Community HTML or GitHub Markdown
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:

Description drew.robey 2017-11-21 12:31:17 UTC
If you setup a Frame element with a border radius his radius is removed if you dynamically change the backcolor during app execution.

I won't patronise with a code example for this one, needless to say I have frames that change color dynamically to indicate the importance of the text in an interior label. When the change occurs the border radius is removed. Attempting to re-apply the border radius (during the color change) does not work.

Conversely on the same screen I have another frame with a border radius, but the backcolor of that one is not changed during execution, and thus the border radius is retained throughout.
Comment 1 Paul DiPietro [MSFT] 2017-11-21 15:49:18 UTC
By "dynamically" I assume you're implying a simple binding changing the value; a basic app/page with a Frame and a set corner radius value doesn't appear to lose that radius when the bound background color is changed. Are you experiencing this on a particular platform? This wasn't made clear.

On a side note, it's absolutely never patronizing to provide a reproduction we can run; this helps us greatly as we can get the same exact code being used by the reporter without having to write one up on our end with guesswork.
Comment 2 drew.robey 2017-11-21 16:02:46 UTC
Not even using explicit data binding: I mean just basically altering the backcolor manually in the code-behind, from maybe a button click, or timed loop.

The Frame's style (including an explicit corner radius of 10) is defined in app.xaml, and applied to the Frame in the particular screen's .xaml file. The rest of the frame styling stays put, it just strips the corner radius part of it when we change the backcolor.

I'm experiencing this when compiling to Android v6 onwards. A colleague has confirmed that this also occurs on iOS, however I have not seen this myself, as I don't explicitly work on the iOS side, so I can't honestly confirm that one with my own eyes.
Comment 3 drew.robey 2017-11-28 14:25:34 UTC
I've knocked up a quick test case: here's a link to a Dropbox zip file containing the source code to illustrate the issue, the "attach" option keeps refusing to allow me to put it there:
Comment 4 Max 2018-03-16 10:02:14 UTC
The problem only appears with Android. When debugging, the radius value is still the same but visually lost. 
Could you find any work-around?
Comment 5 drew.robey 2018-03-16 14:26:52 UTC
I'm afraid not, I resorted to eliminating the need for the border.

I would speculate that a size changed event, triggered on some control within the page, that changed the radius to zero and then back to its required curve value might re-establish the radius properly, however that's just a guess off the top of my head, and could well be nonsense.
Comment 6 Jon Bachelor 2018-05-16 16:37:32 UTC
My team is seeing this same exact behavior as well. If simply set a static background color, the CornerRadius property works as expected. However, we need the backgroundColor bound to a property of the object being represented in the UI. We have also tried re-setting the CornerRadius to 5 again in the same DataTrigger we use to set the backgroundColor, but the corners stay square. 

As @Max reported, this happens only on Android. Would really love to see a fix for this.