Table of Contents

Class Decorator

Namespace
Avalonia.Controls
Assembly
Avalonia.Controls.dll

Base class for controls which decorate a single child control.

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

Constructors

Decorator()

public Decorator()

Fields

ChildProperty

Defines the Child property.

public static readonly StyledProperty<Control?> ChildProperty

Field Value

StyledProperty<Control>

PaddingProperty

Defines the Padding property.

public static readonly StyledProperty<Thickness> PaddingProperty

Field Value

StyledProperty<Thickness>

Properties

Child

Gets or sets the decorated control.

[Content]
public Control? Child { get; set; }

Property Value

Control

Padding

Gets or sets the padding to place around the Child control.

public Thickness Padding { get; set; }

Property Value

Thickness

Methods

ArrangeOverride(Size)

Positions child elements as part of a layout pass.

protected override Size ArrangeOverride(Size finalSize)

Parameters

finalSize Size

The size available to the control.

Returns

Size

The actual size used.

MeasureOverride(Size)

Measures the control and its child elements as part of a layout pass.

protected override Size MeasureOverride(Size availableSize)

Parameters

availableSize Size

The size available to the control.

Returns

Size

The desired size for the control.