Table of Contents

Class Border

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

A control which decorates a child with a border and background.

public class Border : Decorator, INotifyPropertyChanged, IDataContextProvider, ILogical, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue
Inheritance
Border
Implements
Derived
Inherited Members
Extension Methods

Constructors

Border()

public Border()

Fields

BackgroundProperty

Defines the Background property.

public static readonly StyledProperty<IBrush?> BackgroundProperty

Field Value

StyledProperty<IBrush>

BackgroundSizingProperty

Defines the BackgroundSizing property.

public static readonly StyledProperty<BackgroundSizing> BackgroundSizingProperty

Field Value

StyledProperty<BackgroundSizing>

BorderBrushProperty

Defines the BorderBrush property.

public static readonly StyledProperty<IBrush?> BorderBrushProperty

Field Value

StyledProperty<IBrush>

BorderThicknessProperty

Defines the BorderThickness property.

public static readonly StyledProperty<Thickness> BorderThicknessProperty

Field Value

StyledProperty<Thickness>

BoxShadowProperty

Defines the BoxShadow property.

public static readonly StyledProperty<BoxShadows> BoxShadowProperty

Field Value

StyledProperty<BoxShadows>

CornerRadiusProperty

Defines the CornerRadius property.

public static readonly StyledProperty<CornerRadius> CornerRadiusProperty

Field Value

StyledProperty<CornerRadius>

Properties

Background

Gets or sets a brush with which to paint the background.

public IBrush? Background { get; set; }

Property Value

IBrush

BackgroundSizing

Gets or sets how the background is drawn relative to the border.

public BackgroundSizing BackgroundSizing { get; set; }

Property Value

BackgroundSizing

BorderBrush

Gets or sets a brush with which to paint the border.

public IBrush? BorderBrush { get; set; }

Property Value

IBrush

BorderThickness

Gets or sets the thickness of the border.

public Thickness BorderThickness { get; set; }

Property Value

Thickness

BoxShadow

Gets or sets the box shadow effect parameters

public BoxShadows BoxShadow { get; set; }

Property Value

BoxShadows

ClipToBoundsRadius

Gets a value indicating the corner radius of control's clip bounds

public CornerRadius ClipToBoundsRadius { get; }

Property Value

CornerRadius

CornerRadius

Gets or sets the radius of the border rounded corners.

public CornerRadius CornerRadius { get; set; }

Property Value

CornerRadius

Methods

ArrangeOverride(Size)

Arranges the control's child.

protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize Size

The size allocated to the control.

Returns

Size

The space taken.

MeasureOverride(Size)

Measures the control.

protected override Size MeasureOverride(Size availableSize)

Parameters

availableSize Size

The available size.

Returns

Size

The desired size of the control.

OnPropertyChanged(AvaloniaPropertyChangedEventArgs)

Called when a avalonia property changes on the object.

protected override void OnPropertyChanged(AvaloniaPropertyChangedEventArgs change)

Parameters

change AvaloniaPropertyChangedEventArgs

The property change details.

Render(DrawingContext)

Renders the control.

public override sealed void Render(DrawingContext context)

Parameters

context DrawingContext

The drawing context.