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.
Inherited Members
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
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
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
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
|