New to Telerik UI for WPFStart a free 30-day trial

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:

C#
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

C#
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection, bool isFragment)
Parameters:associatedDocumentElementDocumentElementcollectionDocumentStructureCollectionisFragmentbool
C#
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection)
Parameters:associatedDocumentElementDocumentElementcollectionDocumentStructureCollection
C#
public LayoutBox(DocumentElement associatedDocumentElement)
Parameters:associatedDocumentElementDocumentElement

Fields

AssociatedLayoutBoxProperty

DependencyProperty

C#
public static readonly DependencyProperty AssociatedLayoutBoxProperty
C#
protected float currentY
C#
public BoxNode Node

Properties

Gets the associated document element for the LayoutBox.

C#
public DocumentElement AssociatedDocumentElement { get; }

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

C#
public RectangleF BoundingRectangle { get; }

Gets the child boxes contained within the layout box.

C#
public virtual bool BoundsChildBoxes { get; }
C#
protected virtual bool CanCreateLayoutBoxesFromContent { get; }

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

C#
public int ChildIndex { get; }

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

C#
public LayoutElementCollection ChildLayoutBoxes { get; }

Determines whether the layout box has a visual representation.

C#
public virtual bool HasVisualRepresentation { get; }

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

C#
public virtual bool IsContainerBox { get; }

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

C#
public bool IsFirstBox { get; }

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

C#
public bool IsFirstChild { get; }

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

C#
public virtual bool IsFormattingSymbol { get; }

Gets a value indicating whether the LayoutBox is a fragment.

C#
public bool IsFragment { get; }

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

C#
public virtual bool IsLastBox { get; }

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

C#
public bool IsLastChild { get; }

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

C#
public bool IsRemoved { get; }

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

C#
public virtual bool IsValidPosition { get; }

Gets the parent LayoutBox of the current LayoutBox.

C#
public LayoutBox Parent { get; }

Methods

C#
protected bool? CanGrowVertically(float desiredHeight)
Parameters:desiredHeightfloatReturns:

bool?

C#
protected virtual bool? CanGrowVerticallyOverride(float desiredHeight)
Parameters:desiredHeightfloatReturns:

bool?

C#
protected override ILinkedListCollection<LayoutElement> CreateChildrenCollection(DocumentStructureCollection collection)
Parameters:collectionDocumentStructureCollectionReturns:

ILinkedListCollection<LayoutElement>

Overrides: LayoutElement.CreateChildrenCollection(DocumentStructureCollection)

Creates a new layout element within the LayoutBox.

C#
public abstract LayoutElement CreateLayoutElement()
Returns:

LayoutElement

A new instance of a layout element.

Creates a new fragment based on the specified layout box.

C#
public virtual void CreateNewFragment(LayoutBox currentLineStartNode)
Parameters:currentLineStartNodeLayoutBox

The layout box from which to create the new fragment.

Retrieves the associated layout box for the specified UI element.

C#
public static LayoutBox GetAssociatedLayoutBox(UIElement element)
Parameters:elementUIElement

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.

C#
protected virtual float GetBoxDesiredGrow()
Returns:

float

Gets the position of the LayoutBox.

C#
public virtual PositionHandler GetPositionHandler()
Returns:

PositionHandler

A Point representing the position of the LayoutBox.

Retrieves the root document from the layout box.

C#
public RadDocument GetRootDocument()
Returns:

RadDocument

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.

C#
public void InvalidateArrangeUpToTheRoot()

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.

C#
public void InvalidateLayoutAfterEdit()

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

C#
public override void InvalidateMeasure()

Overrides: LayoutElement.InvalidateMeasure()

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.

C#
public void InvalidateMeasureUpToTheRoot()

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

C#
public void InvalidateMeasureUpToTheRootStable()

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

C#
public virtual void MergeWithNext(LayoutBox nextSpanBox)
Parameters:nextSpanBoxLayoutBox

The layout box to merge with the current layout box.

C#
protected virtual void OnAssociateDocumentElementChanged()
C#
protected virtual void OnElementStructureChanged()
C#
protected virtual void OnElementStructureChanging()

Associates a specified UIElement with a LayoutBox.

C#
public static void SetAssociatedLayoutBox(UIElement element, LayoutBox uiElementProvider)
Parameters:elementUIElement

The UIElement to associate with the LayoutBox.

uiElementProviderLayoutBox

The LayoutBox to which the UIElement will be associated.

Returns a string representation of the current LayoutBox instance.

C#
public override string ToString()
Returns:

string

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

Overrides: object.ToString()

Validates the specified child LayoutBox for the current LayoutBox instance.

C#
public void ValidateChild(LayoutBox child)
Parameters:childLayoutBox

The child LayoutBox to be validated.

Events

C#
public event EventHandler ElementStructureChanged
C#
public event EventHandler ElementStructureChanging

Extension Methods