ClassLayoutBox
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:
public abstract class LayoutBox : LayoutElement
Inheritance: objectLayoutElementLayoutBox
Derived Classes:
Inherited Members
Constructors
LayoutBox(DocumentElement)
Declaration
public LayoutBox(DocumentElement associatedDocumentElement)
Parameters
associatedDocumentElement
LayoutBox(DocumentElement, DocumentStructureCollection)
Declaration
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection)
Parameters
associatedDocumentElement
collection
LayoutBox(DocumentElement, DocumentStructureCollection, bool)
Declaration
public LayoutBox(DocumentElement associatedDocumentElement, DocumentStructureCollection collection, bool isFragment)
Parameters
associatedDocumentElement
collection
isFragment
Fields
AssociatedLayoutBoxProperty
Declaration
public static readonly DependencyProperty AssociatedLayoutBoxProperty
Field Value
DependencyProperty
Properties
AssociatedDocumentElement
Gets the associated document element for the LayoutBox.
Declaration
public DocumentElement AssociatedDocumentElement { get; }
Property Value
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
BoundsChildBoxes
Gets the child boxes contained within the layout box.
CanCreateLayoutBoxesFromContent
Declaration
protected virtual bool CanCreateLayoutBoxesFromContent { get; }
Property Value
ChildIndex
Gets the index of the child element within the layout box.
ChildLayoutBoxes
Gets the collection of child layout boxes contained within the layout box.
Declaration
public LayoutElementCollection ChildLayoutBoxes { get; }
Property Value
HasVisualRepresentation
Determines whether the layout box has a visual representation.
Declaration
public virtual bool HasVisualRepresentation { get; }
Property Value
IsContainerBox
Gets a value indicating whether the layout box is a container box.
IsFirstBox
Gets a value indicating whether the current layout box is the first box in its parent layout container.
IsFirstChild
Gets a value indicating whether the current layout box is the first child of its parent.
IsFormattingSymbol
Gets or sets a value indicating whether the LayoutBox should use formatting symbols.
IsFragment
Gets a value indicating whether the LayoutBox is a fragment.
IsLastBox
Gets a value indicating whether the current LayoutBox is the last box in its parent container.
IsLastChild
Gets a value indicating whether this LayoutBox is the last child in its parent container.
IsRemoved
Gets a value indicating whether the layout box has been removed from the layout.
IsValidPosition
Determines whether the specified position is valid within the layout box.
Methods
CreateChildrenCollection(DocumentStructureCollection)
Declaration
protected override ILinkedListCollection<LayoutElement> CreateChildrenCollection(DocumentStructureCollection collection)
Parameters
collection
Returns
Overrides
CreateLayoutElement()
Creates a new layout element within the LayoutBox.
Declaration
public abstract LayoutElement CreateLayoutElement()
Returns
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
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
element
UIElement
The UI element for which to retrieve the associated layout box.
Returns
The layout box associated with the specified UI element, or null if none exists.
GetPositionHandler()
Gets the position of the LayoutBox.
Declaration
public virtual PositionHandler GetPositionHandler()
Returns
A Point representing the position of the LayoutBox.
GetRootDocument()
Retrieves the root document from the layout box.
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
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
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
element
UIElement
The UIElement to associate with the 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
A string that describes the LayoutBox object, which may include its properties and state.
Overrides
ValidateChild(LayoutBox)
Validates the specified child LayoutBox for the current LayoutBox instance.
Declaration
public void ValidateChild(LayoutBox child)
Parameters
child
The child LayoutBox to be validated.
Events
ElementStructureChanged
Declaration
public event EventHandler ElementStructureChanged
Event Value
ElementStructureChanging
Declaration
public event EventHandler ElementStructureChanging
Event Value