2016-03-30 01:41:39 +03:00
|
|
|
|
using System;
|
|
|
|
|
|
|
|
|
|
using Xamarin.Forms.CustomAttributes;
|
2016-04-26 18:20:55 +03:00
|
|
|
|
using Xamarin.Forms.Internals;
|
2016-03-30 01:41:39 +03:00
|
|
|
|
|
2018-11-07 01:00:08 +03:00
|
|
|
|
namespace Xamarin.Forms.Controls.Issues
|
2016-03-30 01:41:39 +03:00
|
|
|
|
{
|
|
|
|
|
[Preserve(AllMembers = true)]
|
2018-05-16 02:13:08 +03:00
|
|
|
|
[Issue(IssueTracker.Bugzilla, 39853, "BorderRadius ignored on UWP", PlatformAffected.UWP)]
|
2016-03-30 01:41:39 +03:00
|
|
|
|
public class Bugzilla39853 : TestContentPage
|
|
|
|
|
{
|
|
|
|
|
public class RoundedButton : Xamarin.Forms.Button
|
|
|
|
|
{
|
|
|
|
|
public RoundedButton(int radius)
|
|
|
|
|
{
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning disable 0618
|
2016-03-30 01:41:39 +03:00
|
|
|
|
base.BorderRadius = radius;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning restore
|
2016-03-30 01:41:39 +03:00
|
|
|
|
base.WidthRequest = 2 * radius;
|
|
|
|
|
base.HeightRequest = 2 * radius;
|
|
|
|
|
HorizontalOptions = LayoutOptions.Center;
|
|
|
|
|
VerticalOptions = LayoutOptions.Center;
|
|
|
|
|
BackgroundColor = Color.Aqua;
|
|
|
|
|
BorderColor = Color.White;
|
|
|
|
|
TextColor = Color.Purple;
|
|
|
|
|
Text = "YAY";
|
2018-05-16 02:13:08 +03:00
|
|
|
|
//Image = new FileImageSource { File = "crimson.jpg" };
|
2016-03-30 01:41:39 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public new int BorderRadius
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning disable 0618
|
2016-03-30 01:41:39 +03:00
|
|
|
|
return base.BorderRadius;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning restore
|
2016-03-30 01:41:39 +03:00
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
base.WidthRequest = 2 * value;
|
|
|
|
|
base.HeightRequest = 2 * value;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning disable 0618
|
2016-03-30 01:41:39 +03:00
|
|
|
|
base.BorderRadius = value;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning restore
|
2016-03-30 01:41:39 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public new double WidthRequest
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return base.WidthRequest;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
base.WidthRequest = value;
|
|
|
|
|
base.HeightRequest = value;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning disable 0618
|
2016-03-30 01:41:39 +03:00
|
|
|
|
base.BorderRadius = ((int)value) / 2;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning restore
|
2016-03-30 01:41:39 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
public new double HeightRequest
|
|
|
|
|
{
|
|
|
|
|
get
|
|
|
|
|
{
|
|
|
|
|
return base.HeightRequest;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
set
|
|
|
|
|
{
|
|
|
|
|
base.WidthRequest = value;
|
|
|
|
|
base.HeightRequest = value;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning disable 0618
|
2016-03-30 01:41:39 +03:00
|
|
|
|
base.BorderRadius = ((int)value) / 2;
|
2018-02-08 20:55:08 +03:00
|
|
|
|
#pragma warning restore
|
2016-03-30 01:41:39 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|
2018-05-16 02:13:08 +03:00
|
|
|
|
|
2016-03-30 01:41:39 +03:00
|
|
|
|
protected override void Init()
|
|
|
|
|
{
|
2018-05-16 02:13:08 +03:00
|
|
|
|
var layout = new StackLayout();
|
|
|
|
|
|
|
|
|
|
var instructions = new Label { Text = "The button below should be round. "
|
|
|
|
|
+ "If it has any right angles, the test has failed."};
|
|
|
|
|
|
|
|
|
|
layout.Children.Add(instructions);
|
|
|
|
|
layout.Children.Add(new RoundedButton(100));
|
|
|
|
|
|
|
|
|
|
Content = layout;
|
2016-03-30 01:41:39 +03:00
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
}
|