diff --git a/src/Controls/src/Core/BorderElement.cs b/src/Controls/src/Core/BorderElement.cs index 0253f5c1b5fb..cb1ec2fe41d0 100644 --- a/src/Controls/src/Core/BorderElement.cs +++ b/src/Controls/src/Core/BorderElement.cs @@ -14,7 +14,7 @@ static class BorderElement propertyChanged: OnBorderColorPropertyChanged); /// Bindable property for . - public static readonly BindableProperty BorderWidthProperty = BindableProperty.Create(nameof(IBorderElement.BorderWidth), typeof(double), typeof(IBorderElement), -1d); + public static readonly BindableProperty BorderWidthProperty = BindableProperty.Create(nameof(IBorderElement.BorderWidth), typeof(double), typeof(IBorderElement), 0d); /// Bindable property for . public static readonly BindableProperty CornerRadiusProperty = BindableProperty.Create(nameof(IBorderElement.CornerRadius), typeof(int), typeof(IBorderElement), defaultValue: DefaultCornerRadius); diff --git a/src/Controls/src/Core/RadioButton/RadioButton.cs b/src/Controls/src/Core/RadioButton/RadioButton.cs index 553d00ac2b10..6a83884c2984 100644 --- a/src/Controls/src/Core/RadioButton/RadioButton.cs +++ b/src/Controls/src/Core/RadioButton/RadioButton.cs @@ -459,9 +459,7 @@ static View BuildDefaultTemplate() border.SetBinding(Border.StrokeProperty, static (RadioButton rb) => rb.BorderColor, source: RelativeBindingSource.TemplatedParent); border.SetBinding(Border.StrokeShapeProperty, static (RadioButton rb) => rb.CornerRadius, source: RelativeBindingSource.TemplatedParent, converter: new CornerRadiusToShape()); - - // NonNegativeValueConverter ensures that StrokeThickness remains non-negative as the default value of -1 triggers a CGContextSetLineWidth error on iOS. - border.SetBinding(Border.StrokeThicknessProperty, static (RadioButton rb) => rb.BorderWidth, source: RelativeBindingSource.TemplatedParent, converter: new NonNegativeValueConverter()); + border.SetBinding(Border.StrokeThicknessProperty, static (RadioButton rb) => rb.BorderWidth, source: RelativeBindingSource.TemplatedParent); var grid = new Grid { @@ -696,18 +694,5 @@ public object ConvertBack(object value, Type targetType, object parameter, Syste throw new NotImplementedException(); } } - - class NonNegativeValueConverter : IValueConverter - { - public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - return Math.Max(0, (double)value); - } - - public object ConvertBack(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture) - { - throw new NotImplementedException(); - } - } } }