Class
LayoutBox

Represents a layout box in the Telerik document layout system. This class is responsible for managing the layout structure and visual representation of elements within a document, allowing for complex arrangements and styling.

Definition

Namespace:Telerik.Windows.Documents.Layout

Assembly:Telerik.Windows.Controls.RichTextBox.dll

Syntax:

cs-api-definition
public abstract class LayoutBox : LayoutElement

Inheritance: objectLayoutElementLayoutBox

Derived Classes: DocumentLayoutBoxFlowOrderedLayoutBoxInlineLayoutBoxParagraphLayoutBoxSectionLayoutBoxTableLayoutBox

Inherited Members LayoutElement.EnsureChildrenCreated()LayoutElement.CreateChildren()LayoutElement.OnBitStateChanged(DocumentElementStates, bool, bool)LayoutElement.SetBitState(DocumentElementStates, bool)LayoutElement.ValidateParent(LayoutElement)LayoutElement.SetParent(LayoutElement, LayoutElement)LayoutElement.SetParentCore(LayoutElement)LayoutElement.IsInValidState(bool)LayoutElement.OnInvalidateMeasure()LayoutElement.InvalidateMeasure(bool)LayoutElement.InvalidateArrange()LayoutElement.OnInvalidateArrange()LayoutElement.InvalidateArrange(bool)LayoutElement.Arrange(RectangleF)LayoutElement.ArrangeCore(RectangleF)LayoutElement.ArrangeOverride(SizeF)LayoutElement.Measure(SizeF)LayoutElement.MeasureCore(SizeF)LayoutElement.MeasureOverride(SizeF)LayoutElement.OnChildDesiredSizeChanged(LayoutElement)LayoutElement.OnParentChanging()LayoutElement.OnParentChanged()LayoutElement.LayoutOffsetLayoutElement.IsTopContainerLayoutElement.LocalBoundingRectangleLayoutElement.ControlBoundingRectangleLayoutElement.ClippedControlBoundingRectangleLayoutElement.TotalTransformLayoutElement.ChildrenLayoutElement.BitStateLayoutElement.DesiredSizeLayoutElement.IsMeasureInProgressLayoutElement.BypassLayoutPoliciesLayoutElement.MeasureWithoutParentNotificationLayoutElement.SizeLayoutElement.IsArrangeValidLayoutElement.IsMeasureValidLayoutElement.TreeLevelLayoutElement.PreviousArrangeRectLayoutElement.AlignmentLayoutElement.AutoSizeLayoutElement.TransformLayoutElement.ParentChangingLayoutElement.ParentChanged

Constructors

LayoutBox(DocumentElement)

Declaration

cs-api-definition
public LayoutBox(DocumentElement associatedDocumentElement)

Parameters

associatedDocumentElement

DocumentElement

LayoutBox(DocumentElement, DocumentStructureCollection)

Declaration

cs-api-definition
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection)

Parameters

associatedDocumentElement

DocumentElement

collection

DocumentStructureCollection

LayoutBox(DocumentElement, DocumentStructureCollection, bool)

Declaration

cs-api-definition
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection, bool isFragment)

Parameters

associatedDocumentElement

DocumentElement

collection

DocumentStructureCollection

isFragment

bool

Fields

AssociatedLayoutBoxProperty

Declaration

cs-api-definition
public static readonly DependencyProperty AssociatedLayoutBoxProperty

Field Value

DependencyProperty

Node

Declaration

cs-api-definition
public BoxNode Node

Field Value

BoxNode

currentY

Declaration

cs-api-definition
protected float currentY

Field Value

float

Properties

AssociatedDocumentElement

Gets the associated document element for the LayoutBox.

Declaration

cs-api-definition
public DocumentElement AssociatedDocumentElement { get; }

Property Value

DocumentElement

BoundingRectangle

Gets the bounding rectangle of the layout box, which defines the area occupied by the box within the layout.

Declaration

cs-api-definition
public RectangleF BoundingRectangle { get; }

Property Value

RectangleF

BoundsChildBoxes

Gets the child boxes contained within the layout box.

Declaration

cs-api-definition
public virtual bool BoundsChildBoxes { get; }

Property Value

bool

CanCreateLayoutBoxesFromContent

Declaration

cs-api-definition
protected virtual bool CanCreateLayoutBoxesFromContent { get; }

Property Value

bool

ChildIndex

Gets the index of the child element within the layout box.

Declaration

cs-api-definition
public int ChildIndex { get; }

Property Value

int

ChildLayoutBoxes

Gets the collection of child layout boxes contained within the layout box.

Declaration

cs-api-definition
public LayoutElementCollection ChildLayoutBoxes { get; }

Property Value

LayoutElementCollection

HasVisualRepresentation

Determines whether the layout box has a visual representation.

Declaration

cs-api-definition
public virtual bool HasVisualRepresentation { get; }

Property Value

bool

IsContainerBox

Gets a value indicating whether the layout box is a container box.

Declaration

cs-api-definition
public virtual bool IsContainerBox { get; }

Property Value

bool

IsFirstBox

Gets a value indicating whether the current layout box is the first box in its parent layout container.

Declaration

cs-api-definition
public bool IsFirstBox { get; }

Property Value

bool

IsFirstChild

Gets a value indicating whether the current layout box is the first child of its parent.

Declaration

cs-api-definition
public bool IsFirstChild { get; }

Property Value

bool

IsFormattingSymbol

Gets or sets a value indicating whether the LayoutBox should use formatting symbols.

Declaration

cs-api-definition
public virtual bool IsFormattingSymbol { get; }

Property Value

bool

IsFragment

Gets a value indicating whether the LayoutBox is a fragment.

Declaration

cs-api-definition
public bool IsFragment { get; }

Property Value

bool

IsLastBox

Gets a value indicating whether the current LayoutBox is the last box in its parent container.

Declaration

cs-api-definition
public virtual bool IsLastBox { get; }

Property Value

bool

IsLastChild

Gets a value indicating whether this LayoutBox is the last child in its parent container.

Declaration

cs-api-definition
public bool IsLastChild { get; }

Property Value

bool

IsRemoved

Gets a value indicating whether the layout box has been removed from the layout.

Declaration

cs-api-definition
public bool IsRemoved { get; }

Property Value

bool

IsValidPosition

Determines whether the specified position is valid within the layout box.

Declaration

cs-api-definition
public virtual bool IsValidPosition { get; }

Property Value

bool

Parent

Gets the parent LayoutBox of the current LayoutBox.

Declaration

cs-api-definition
public LayoutBox Parent { get; }

Property Value

LayoutBox

Methods

CanGrowVertically(float)

Declaration

cs-api-definition
protected bool? CanGrowVertically(float desiredHeight)

Parameters

desiredHeight

float

Returns

bool?

CanGrowVerticallyOverride(float)

Declaration

cs-api-definition
protected virtual bool? CanGrowVerticallyOverride(float desiredHeight)

Parameters

desiredHeight

float

Returns

bool?

CreateChildrenCollection(DocumentStructureCollection)

Declaration

cs-api-definition
protected override ILinkedListCollection<LayoutElement> CreateChildrenCollection(DocumentStructureCollection collection)

Parameters

collection

DocumentStructureCollection

Returns

ILinkedListCollection<LayoutElement>

Overrides LayoutElement.CreateChildrenCollection(DocumentStructureCollection)

CreateLayoutElement()

Creates a new layout element within the LayoutBox.

Declaration

cs-api-definition
public abstract LayoutElement CreateLayoutElement()

Returns

LayoutElement

A new instance of a layout element.

CreateNewFragment(LayoutBox)

Creates a new fragment based on the specified layout box.

Declaration

cs-api-definition
public virtual void CreateNewFragment(LayoutBox currentLineStartNode)

Parameters

currentLineStartNode

LayoutBox

The layout box from which to create the new fragment.

GetAssociatedLayoutBox(UIElement)

Retrieves the associated layout box for the specified UI element.

Declaration

cs-api-definition
public static LayoutBox GetAssociatedLayoutBox(UIElement element)

Parameters

element

UIElement

The UI element for which to retrieve the associated layout box.

Returns

LayoutBox

The layout box associated with the specified UI element, or null if none exists.

GetBoxDesiredGrow()

Declaration

cs-api-definition
protected virtual float GetBoxDesiredGrow()

Returns

float

GetPositionHandler()

Gets the position of the LayoutBox.

Declaration

cs-api-definition
public virtual PositionHandler GetPositionHandler()

Returns

PositionHandler

A Point representing the position of the LayoutBox.

GetRootDocument()

Retrieves the root document from the layout box.

Declaration

cs-api-definition
public RadDocument GetRootDocument()

Returns

RadDocument

InvalidateArrangeUpToTheRoot()

Invalidates the arrangement of the layout box and all of its parent elements up to the root. This method recalculates the layout for the box and ensures that the visual tree is updated accordingly.

Declaration

cs-api-definition
public void InvalidateArrangeUpToTheRoot()

InvalidateLayoutAfterEdit()

Invalidates the layout of the layout box after an edit operation. This method should be called whenever there are changes that affect the layout, ensuring that the layout is updated accordingly.

Declaration

cs-api-definition
public void InvalidateLayoutAfterEdit()

InvalidateMeasure()

Invalidates the current measure of the layout box, forcing it to recompute its layout during the next pass of the layout system.

Declaration

cs-api-definition
public override void InvalidateMeasure()

Overrides LayoutElement.InvalidateMeasure()

InvalidateMeasureUpToTheRoot()

Invalidates the measurement of the current layout box and all its parent layout boxes up to the root. This method triggers a re-measure of the layout tree to ensure that all layout boxes reflect the latest changes in their properties or children.

Declaration

cs-api-definition
public void InvalidateMeasureUpToTheRoot()

InvalidateMeasureUpToTheRootStable()

Invalidates the measure of the current LayoutBox and all its parent elements up to the root, ensuring that the layout is recalculated.

Declaration

cs-api-definition
public void InvalidateMeasureUpToTheRootStable()

MergeWithNext(LayoutBox)

Merges the current layout box with the next layout box, if applicable.

Declaration

cs-api-definition
public virtual void MergeWithNext(LayoutBox nextSpanBox)

Parameters

nextSpanBox

LayoutBox

The layout box to merge with the current layout box.

OnAssociateDocumentElementChanged()

Declaration

cs-api-definition
protected virtual void OnAssociateDocumentElementChanged()

OnElementStructureChanged()

Declaration

cs-api-definition
protected virtual void OnElementStructureChanged()

OnElementStructureChanging()

Declaration

cs-api-definition
protected virtual void OnElementStructureChanging()

SetAssociatedLayoutBox(UIElement, LayoutBox)

Associates a specified UIElement with a LayoutBox.

Declaration

cs-api-definition
public static void SetAssociatedLayoutBox(UIElement element, LayoutBox uiElementProvider)

Parameters

element

UIElement

The UIElement to associate with the LayoutBox.

uiElementProvider

LayoutBox

The LayoutBox to which the UIElement will be associated.

ToString()

Returns a string representation of the current LayoutBox instance.

Declaration

cs-api-definition
public override string ToString()

Returns

string

A string that describes the LayoutBox object, which may include its properties and state.

Overrides object.ToString()

ValidateChild(LayoutBox)

Validates the specified child LayoutBox for the current LayoutBox instance.

Declaration

cs-api-definition
public void ValidateChild(LayoutBox child)

Parameters

child

LayoutBox

The child LayoutBox to be validated.

Events

ElementStructureChanged

Declaration

cs-api-definition
public event EventHandler ElementStructureChanged

Event Value

EventHandler

ElementStructureChanging

Declaration

cs-api-definition
public event EventHandler ElementStructureChanging

Event Value

EventHandler

Extension Methods