skip navigation
  • Product Bundles

    DevCraft

    All Telerik .NET tools and Kendo UI JavaScript components in one package. Now enhanced with:

    • NEW: Design Kits for Figma
    • Online Training
    • Document Processing Library
    • Embedded Reporting for web and desktop

    Web

    Kendo UI UI for Angular UI for Vue UI for jQuery KendoReact UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI

    Document Management

    Telerik Document Processing

    Desktop

    UI for .NET MAUI UI for WinUI UI for WinForms UI for WPF

    Reporting

    Telerik Reporting Telerik Report Server

    Testing & Mocking

    Test Studio Telerik JustMock

    CMS

    Sitefinity

    AI Productivity Tools

    AI Coding Assistants

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    KendoReact Free VB.NET to C# Converter Testing Framework
    View all products
  • Overview
  • Demos
    • What's New
    • Roadmap
    • Release History
  • Support and Learning

    • Support and Learning Hub
    • First Steps
    • Docs
    • Demos
    • Virtual Classroom
    • Forums
    • Videos
    • Blogs
    • Accessibility
    • Submit a Ticket

    Productivity and Design Tools

    • Visual Studio Extensions
    • Visual Studio Templates
    • Embedded Reporting
  • Pricing
  • Shopping cart
    • Account Overview
    • Your Licenses
    • Downloads
    • Support Center
    • Forum Profile
    • Payment Methods
    • Edit Profile
    • Log out
  • Login
  • Contact Us
  • Try now

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.

Inheritance
System.Object
LayoutElement
LayoutBox
DocumentLayoutBox
FlowOrderedLayoutBox
InlineLayoutBox
ParagraphLayoutBox
SectionLayoutBox
TableLayoutBox
Inherited Members
LayoutElement.EnsureChildrenCreated()
LayoutElement.CreateChildren()
LayoutElement.OnBitStateChanged(DocumentElementStates, Boolean, Boolean)
LayoutElement.SetBitState(DocumentElementStates, Boolean)
LayoutElement.ValidateParent(LayoutElement)
LayoutElement.SetParent(LayoutElement, LayoutElement)
LayoutElement.SetParentCore(LayoutElement)
LayoutElement.IsInValidState(Boolean)
LayoutElement.OnInvalidateMeasure()
LayoutElement.InvalidateMeasure(Boolean)
LayoutElement.InvalidateArrange()
LayoutElement.OnInvalidateArrange()
LayoutElement.InvalidateArrange(Boolean)
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.LayoutOffset
LayoutElement.IsTopContainer
LayoutElement.LocalBoundingRectangle
LayoutElement.ControlBoundingRectangle
LayoutElement.ClippedControlBoundingRectangle
LayoutElement.TotalTransform
LayoutElement.Children
LayoutElement.BitState
LayoutElement.DesiredSize
LayoutElement.IsMeasureInProgress
LayoutElement.BypassLayoutPolicies
LayoutElement.MeasureWithoutParentNotification
LayoutElement.Size
LayoutElement.IsArrangeValid
LayoutElement.IsMeasureValid
LayoutElement.TreeLevel
LayoutElement.PreviousArrangeRect
LayoutElement.Alignment
LayoutElement.AutoSize
LayoutElement.Transform
LayoutElement.ParentChanging
LayoutElement.ParentChanged
Namespace: Telerik.Windows.Documents.Layout
Assembly: Telerik.Windows.Controls.RichTextBox.dll

Syntax

public abstract class LayoutBox : LayoutElement
Remarks

This class inherits from the base layout structure and provides additional properties and methods for handling specific layout scenarios.

Constructors

LayoutBox(DocumentElement)

Declaration
public LayoutBox(DocumentElement associatedDocumentElement)
Parameters
DocumentElement associatedDocumentElement

LayoutBox(DocumentElement, DocumentStructureCollection)

Declaration
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection)
Parameters
DocumentElement associatedDocumentElement

DocumentStructureCollection collection

LayoutBox(DocumentElement, DocumentStructureCollection, Boolean)

Declaration
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection, bool isFragment)
Parameters
DocumentElement associatedDocumentElement

DocumentStructureCollection collection

System.Boolean isFragment

Fields

AssociatedLayoutBoxProperty

Declaration
public static readonly DependencyProperty AssociatedLayoutBoxProperty
Field Value
System.Windows.DependencyProperty

currentY

Declaration
protected float currentY
Field Value
System.Single

Node

Declaration
public BoxNode Node
Field Value
BoxNode

Properties

AssociatedDocumentElement

Gets the associated document element for the LayoutBox.

Declaration
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
public RectangleF BoundingRectangle { get; }
Property Value
RectangleF

BoundsChildBoxes

Gets the child boxes contained within the layout box.

Declaration
public virtual bool BoundsChildBoxes { get; }
Property Value
System.Boolean

CanCreateLayoutBoxesFromContent

Declaration
protected virtual bool CanCreateLayoutBoxesFromContent { get; }
Property Value
System.Boolean

ChildIndex

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

Declaration
public int ChildIndex { get; }
Property Value
System.Int32

ChildLayoutBoxes

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

Declaration
public LayoutElementCollection ChildLayoutBoxes { get; }
Property Value
LayoutElementCollection

HasVisualRepresentation

Determines whether the layout box has a visual representation.

Declaration
public virtual bool HasVisualRepresentation { get; }
Property Value
System.Boolean

IsContainerBox

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

Declaration
public virtual bool IsContainerBox { get; }
Property Value
System.Boolean

IsFirstBox

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

Declaration
public bool IsFirstBox { get; }
Property Value
System.Boolean

IsFirstChild

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

Declaration
public bool IsFirstChild { get; }
Property Value
System.Boolean

IsFormattingSymbol

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

Declaration
public virtual bool IsFormattingSymbol { get; }
Property Value
System.Boolean

IsFragment

Gets a value indicating whether the LayoutBox is a fragment.

Declaration
public bool IsFragment { get; }
Property Value
System.Boolean

IsLastBox

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

Declaration
public virtual bool IsLastBox { get; }
Property Value
System.Boolean

IsLastChild

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

Declaration
public bool IsLastChild { get; }
Property Value
System.Boolean

IsRemoved

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

Declaration
public bool IsRemoved { get; }
Property Value
System.Boolean

IsValidPosition

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

Declaration
public virtual bool IsValidPosition { get; }
Property Value
System.Boolean

Parent

Gets the parent LayoutBox of the current LayoutBox.

Declaration
public LayoutBox Parent { get; }
Property Value
LayoutBox

Methods

CanGrowVertically(Single)

Declaration
protected Nullable<bool> CanGrowVertically(float desiredHeight)
Parameters
System.Single desiredHeight

Returns
System.Nullable<System.Boolean>

CanGrowVerticallyOverride(Single)

Declaration
protected virtual Nullable<bool> CanGrowVerticallyOverride(float desiredHeight)
Parameters
System.Single desiredHeight

Returns
System.Nullable<System.Boolean>

CreateChildrenCollection(DocumentStructureCollection)

Declaration
protected override ILinkedListCollection<LayoutElement> CreateChildrenCollection(DocumentStructureCollection collection)
Parameters
DocumentStructureCollection collection

Returns
ILinkedListCollection<LayoutElement>

Overrides
LayoutElement.CreateChildrenCollection(DocumentStructureCollection)

CreateLayoutElement()

Creates a new layout element within the LayoutBox.

Declaration
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
public virtual void CreateNewFragment(LayoutBox currentLineStartNode)
Parameters
LayoutBox currentLineStartNode

The layout box from which to create the new fragment.

GetAssociatedLayoutBox(UIElement)

Retrieves the associated layout box for the specified UI element.

Declaration
public static LayoutBox GetAssociatedLayoutBox(UIElement element)
Parameters
System.Windows.UIElement element

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
protected virtual float GetBoxDesiredGrow()
Returns
System.Single

GetPositionHandler()

Gets the position of the LayoutBox.

Declaration
public virtual PositionHandler GetPositionHandler()
Returns
PositionHandler

A System.Windows.Point representing the position of the LayoutBox.

GetRootDocument()

Retrieves the root document from the layout box.

Declaration
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
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
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
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
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
public void InvalidateMeasureUpToTheRootStable()

MergeWithNext(LayoutBox)

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

Declaration
public virtual void MergeWithNext(LayoutBox nextSpanBox)
Parameters
LayoutBox nextSpanBox

The layout box to merge with the current layout box.

OnAssociateDocumentElementChanged()

Declaration
protected virtual void OnAssociateDocumentElementChanged()

OnElementStructureChanged()

Declaration
protected virtual void OnElementStructureChanged()

OnElementStructureChanging()

Declaration
protected virtual void OnElementStructureChanging()

SetAssociatedLayoutBox(UIElement, LayoutBox)

Associates a specified UIElement with a LayoutBox.

Declaration
public static void SetAssociatedLayoutBox(UIElement element, LayoutBox uiElementProvider)
Parameters
System.Windows.UIElement element

The UIElement to associate with the LayoutBox.

LayoutBox uiElementProvider

The LayoutBox to which the UIElement will be associated.

ToString()

Returns a string representation of the current LayoutBox instance.

Declaration
public override string ToString()
Returns
System.String

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

ValidateChild(LayoutBox)

Validates the specified child LayoutBox for the current LayoutBox instance.

Declaration
public void ValidateChild(LayoutBox child)
Parameters
LayoutBox child

The child LayoutBox to be validated.

Events

ElementStructureChanged

Declaration
public event EventHandler ElementStructureChanged
Event Type
System.EventHandler

ElementStructureChanging

Declaration
public event EventHandler ElementStructureChanging
Event Type
System.EventHandler

Extension Methods

ExtensionMethods.GetCurrentSectionBox(LayoutBox)
CollectionExtensions.ToEnumerable<T>(T)
EnumerableExtensions.ToEnumerable<T>(T)
Getting Started
  • Install Now
  • Demos
  • SDK Samples Browser
  • Sample Applications
Support Resources
  • Code Library
  • Knowledge Base
  • MVVM Support
  • Videos
  • GitHub SDK Repository
Community
  • Forums
  • Blogs
  • XAML Feedback Portal
  • Document Processing Feedback Portal

Copyright © 2018 Progress Software Corporation and/or its subsidiaries or affiliates.
All Rights Reserved.

Progress, Telerik, and certain product names used herein are trademarks or registered trademarks of Progress Software Corporation and/or one of its subsidiaries or affiliates in the U.S. and/or other countries. See Trademarks for appropriate markings.