Table of Contents

Class BoxModelResolver

Namespace
Icy.Diagnostics
Assembly
IcyUI.dll

Resolves a BoxModel for an arbitrary UIElement.

public static class BoxModelResolver
Inheritance
BoxModelResolver
Inherited Members

Remarks

UIElement itself has no generic margin/border/padding/content-box concept - only ActualBounds/Margin are universal. BorderThickness (for a padding box) and IContainerLayout.ContentBounds (for a content box) exist only on some subtypes (Border, Control, Panel). This resolver degrades gracefully instead of assuming every element has every box, without adding any new members to those types - a plain UIElement resolves to margin/border boxes only.

Methods

Resolve(UIElement)

Resolves element's box model.

public static BoxModel Resolve(UIElement element)

Parameters

element UIElement

The element to resolve boxes for.

Returns

BoxModel

The element's margin and border boxes, plus its padding/content boxes when available.