Table of Contents

Struct BoxModel

Namespace
Icy.Diagnostics
Assembly
IcyUI.dll

The nested rectangles a devtools-style layout overlay draws for one element - however many of them the element's own type actually exposes, per BoxModelResolver's remarks.

public readonly record struct BoxModel : IEquatable<BoxModel>
Implements
Inherited Members
Extension Methods

Remarks

Every rectangle is in the element's own local space - (0,0) at its top-left - matching the convention Transform already represents when Render(UIElement, IRenderContext) runs.

Constructors

BoxModel(Rectangle, Rectangle, Rectangle?, Rectangle?)

The nested rectangles a devtools-style layout overlay draws for one element - however many of them the element's own type actually exposes, per BoxModelResolver's remarks.

public BoxModel(Rectangle MarginBox, Rectangle BorderBox, Rectangle? PaddingBox, Rectangle? ContentBox)

Parameters

MarginBox Rectangle

The element's border box expanded outward by its Margin.

BorderBox Rectangle

The element's own local bounds - (0,0) sized to ActualBounds.

PaddingBox Rectangle?

The border box inset by BorderThickness, or null if the element's runtime type exposes no such property.

ContentBox Rectangle?

The element's IContainerLayout.ContentBounds translated into local space, or null if the element doesn't implement IContainerLayout.

Remarks

Every rectangle is in the element's own local space - (0,0) at its top-left - matching the convention Transform already represents when Render(UIElement, IRenderContext) runs.

Properties

BorderBox

The element's own local bounds - (0,0) sized to ActualBounds.

public Rectangle BorderBox { get; init; }

Property Value

Rectangle

ContentBox

The element's IContainerLayout.ContentBounds translated into local space, or null if the element doesn't implement IContainerLayout.

public Rectangle? ContentBox { get; init; }

Property Value

Rectangle?

MarginBox

The element's border box expanded outward by its Margin.

public Rectangle MarginBox { get; init; }

Property Value

Rectangle

PaddingBox

The border box inset by BorderThickness, or null if the element's runtime type exposes no such property.

public Rectangle? PaddingBox { get; init; }

Property Value

Rectangle?