Class Border
A view that draws a background, border, and padding around a single child content view.
public class Border : View
- Inheritance
-
Border
- Inherited Members
Properties
BackgroundColor
Gets or sets the background color inside the border.
public Color BackgroundColor { get; set; }
Property Value
BorderColor
Gets or sets the color of the border stroke.
public Color BorderColor { get; set; }
Property Value
BorderThickness
Gets or sets the thickness of the border on each side.
public Frame BorderThickness { get; set; }
Property Value
Content
Gets or sets the content view displayed inside the border.
public View? Content { get; set; }
Property Value
CornerRadius
Gets or sets the corner radius used to round the corners of the border and background.
public CornerRadius CornerRadius { get; set; }
Property Value
Padding
Gets or sets the padding between the border and the content.
public Frame Padding { get; set; }
Property Value
Methods
ArrangeCore(Rect, IMeasureContext)
Performs the layout pass by arranging content and children within the view's border edge box, using the provided rectangle.
protected override void ArrangeCore(Rect rect, IMeasureContext context)
Parameters
rect
RectThe final rectangle (position and size) allocated to this view's border edge box.
context
IMeasureContextThe layout metrics context providing access to platform-specific measurements, text sizing, and pixel snapping utilities.
MeasureCore(Size, IMeasureContext)
Determines the minimum size that this view's border edge box requires, given the maximum available size. Margin is not part of this size.
protected override Size MeasureCore(Size constraints, IMeasureContext context)
Parameters
constraints
Sizecontext
IMeasureContextThe layout metrics context providing access to platform-specific measurements, text sizing, and pixel snapping utilities.
Returns
- Size
The desired size of the border edge box based on content and layout logic.
RenderCore(IContext)
Renders the content and children of this view using the provided rendering context.
protected override void RenderCore(IContext context)
Parameters
context
IContextThe drawing context used for rendering visual content to the output surface.