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
MarginBoxRectangleThe element's border box expanded outward by its
Margin.BorderBoxRectangleThe element's own local bounds -
(0,0)sized toActualBounds.PaddingBoxRectangle?The border box inset by
BorderThickness, or null if the element's runtime type exposes no such property.ContentBoxRectangle?The element's
IContainerLayout.ContentBoundstranslated into local space, or null if the element doesn't implementIContainerLayout.
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
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
MarginBox
The element's border box expanded outward by its Margin.
public Rectangle MarginBox { get; init; }
Property Value
PaddingBox
The border box inset by BorderThickness, or null if the element's runtime type
exposes no such property.
public Rectangle? PaddingBox { get; init; }