Skip to content

[Spec] Rounded Corners #10

@jsuarezruiz

Description

@jsuarezruiz

Rounded Corners

Rounded Corners are a common visual requirement.

corners

API

We need to add an interface for defining what's required for a View to implement corner rounding (and provide CSS support):

interface IRoundedCorner
{
	CornerRadius CornerRadius { get; }
	void CornerRadiusChanged(CornerRadius oldValue, CornerRadius newValue);
}

The CornerRadius BindableProperty can be implemented in one place:

static class RoundedCorner
{
	public static readonly BindableProperty CornerRadiusProperty = 
	     BindableProperty.Create(nameof(CornerRadius), typeof(CornerRadius), typeof(IRoundedCorners));
}

The following Views are candidates for rounded corners:

  • BoxView
  • Button
  • Image
  • ImageButton
  • Layouts
  • ScrollView

Scenarios

C# Example

var grid = new Grid();
grid.CornerRadius = new CornerRadius(12, 0, 12, 6);

XAML Example

<Grid
     CornerRadius="12, 0, 12, 6">
</Grid>

Difficulty: Medium

Providing the interface is simple; individual implementations may vary in difficulty.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions