Bug 39464 - [UWP Forms] Rounded Button Corners do not render in Forms (but do in native UWP)
Summary: [UWP Forms] Rounded Button Corners do not render in Forms (but do in native UWP)
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Windows (show other bugs)
Version: 2.0.0
Hardware: PC Mac OS
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-03-08 20:31 UTC by Matthew Regul
Modified: 2016-04-26 20:11 UTC (History)
8 users (show)

Tags: ac
Is this bug a regression?: ---
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 on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Matthew Regul 2016-03-08 20:31:11 UTC
== Overview: =================================
Rounded button corners do not work within UWP Forms, but will work in a native UWP app.

Screenshots:
Android - https://cloud.githubusercontent.com/assets/8008527/13614328/f5d9d3ac-e53d-11e5-96ee-43c0d745a6dc.png
Windows - https://cloud.githubusercontent.com/assets/8008527/13614379/2b20d7a4-e53e-11e5-9a15-7ae080b49e39.png

[See private note for more details]
Comment 2 philip.o 2016-03-08 20:38:58 UTC
The issues is that is impossible to make rounded corners even if using templates in the renderer.

I have the effect I want on a native UWP app here:
https://bitbucket.org/pogorman_jca/uwpbutton
If I load this style in a renderer in a Forms app it still has the nasty corners (in the color of the button background).
When forms creates the button it paints the entire rectangle of the button the specified background color. There is nothing from the renderer I can do to clear that color. So no matter what changes I make to the native Control in my renderer I cannot get rid of the original color set by Forms.

public class CustomButtonRenderer : ButtonRenderer
{

protected override void OnElementChanged(ElementChangedEventArgs<Xamarin.Forms.Button> e)
{
base.OnElementChanged(e);
var button = (RoundedButton)e.NewElement;
if (Control != null)
{
button.SizeChanged += OnSizeChanged;
}

}
private void OnSizeChanged(object sender, EventArgs e)
{
var button = (RoundedButton)sender;
Control.Style = (Style)Application.Current.Resources["RoundedButtonStyle"];
button.SizeChanged -= OnSizeChanged;
}


}
Comment 7 Rui Marinho 2016-04-01 10:11:47 UTC
Should be fixed in 2.2-pre1