Skip to content
This repository was archived by the owner on May 1, 2024. It is now read-only.
This repository was archived by the owner on May 1, 2024. It is now read-only.

Corner Treatments #5280

@PureWeen

Description

@PureWeen

Layout Corner APIs

The following APIs will be applicable to all elements that are able to support the native level shapes. Currently this should just be for Cards and Buttons

public namespace Xamarin.Forms
{
    public class CornerShapeModel
    {
        public CornerTreatment TopLeft;
        public CornerTreatment TopRight;
        public CornerTreatment BottomLeft;
        public CornerTreatment BottomRight;
    }

    public enum UnitType
    {
        Percentage, Points
    }

    public class CornerTreatment
    {
    }

    public class RoundedCornerTreatment : CornerTreatment
    {
        public double Radius { get; set; }
        public UnitType Unit { get; set; }
    }
    public class CutCornerTreatment : CornerTreatment
    {
        public double Size { get; set; }
        public UnitType Unit { get; set; }         
    }

    public static CornerShapeModel Corners { get; set; } //BP
}

<Button CornerShape="cut:5%, circle:4, circle:10, cut:3%">
</Button>
<Frame CornerShape="cut:5%, circle:4, circle:10, cut:3%">
</Frame>

<!-- this will just apply circles to everything -->
<Button CornerShape="circle:5%, 4, 10, 3%">

<!-- defaults to round -->
<Button CornerShape="5%, 4, 10, 3%">
</Button>

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions