ClassSpanLayoutBox
Represents a layout box for a span element in the Telerik document model.
Definition
Namespace:Telerik.Windows.Documents.Layout
Assembly:Telerik.Windows.Controls.RichTextBox.dll
Syntax:
public class SpanLayoutBox : InlineLayoutBox, INotifyPropertyChanged
Inheritance: objectLayoutElementLayoutBoxInlineLayoutBoxSpanLayoutBox
Derived Classes:
Implements:
Inherited Members
Constructors
SpanLayoutBox(DocumentElement, DocumentStructureCollection)
Declaration
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection)
Parameters
parentElement
collection
SpanLayoutBox(DocumentElement, DocumentStructureCollection, bool)
Declaration
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, bool isFragment)
Parameters
parentElement
collection
isFragment
SpanLayoutBox(DocumentElement, DocumentStructureCollection, string)
Declaration
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)
Parameters
parentElement
collection
text
Properties
AssociatedSpan
Gets or sets the associated span for the SpanLayoutBox.
BaselineOffset
Gets the baseline offset of the span layout box, which indicates the distance from the top of the box to its baseline.
Declaration
public override float BaselineOffset { get; }
Property Value
Overrides
CanCreateLayoutBoxesFromContent
Declaration
protected override bool CanCreateLayoutBoxesFromContent { get; }
Property Value
Overrides
DesiredTextSize
Gets the desired size of the text within the SpanLayoutBox.
HasWidthAtTheEndOfLine
Indicates whether the layout box has a defined width at the end of the line.
Declaration
public override bool HasWidthAtTheEndOfLine { get; }
Property Value
Overrides
IsContainerBox
Indicates whether the span layout box is a container box.
Declaration
public override bool IsContainerBox { get; }
Property Value
Overrides
IsDecimal
Gets a value indicating whether the current SpanLayoutBox represents a decimal number.
IsParagraphSymbol
Gets a value indicating whether the current layout box represents a paragraph symbol.
IsReadonly
Gets or sets a value indicating whether the layout box is in a read-only state.
Declaration
public override bool IsReadonly { get; }
Property Value
Overrides
IsSplittable
Gets or sets a value indicating whether the span layout box can be split.
Declaration
public override bool IsSplittable { get; }
Property Value
true if the span layout box is splitable; otherwise, false.
Overrides
PositionsCountInBox
Gets the number of positions within the layout box.
Declaration
public override int PositionsCountInBox { get; }
Property Value
Overrides
Methods
ContainsFormattingSymbol(string)
Determines whether the specified string contains a formatting symbol.
CreateLayoutElement()
Creates a layout element from the current span layout box.
Declaration
public override LayoutElement CreateLayoutElement()
Returns
A new layout element that represents the span layout box.
Overrides
CreateNewFragment(float, bool)
Creates a new fragment with the specified height and visibility status.
Declaration
public override LayoutBox CreateNewFragment(float availableWidth, bool isFirstBoxInLine)
Parameters
availableWidth
The available width for the new fragment.
isFirstBoxInLine
A boolean indicating whether this is the first box in the current line
Returns
A new instance of the LayoutBox class representing the created fragment.
Overrides
CreateSpanLayoutBox(DocumentElement, DocumentStructureCollection, string)
Creates a new instance of SpanLayoutBox for the specified document element using the provided document structure collection and text.
Declaration
public static SpanLayoutBox CreateSpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)
Parameters
parentElement
The document element for which the span layout box is being created.
collection
A collection of document structures related to the layout.
text
The text in the current SpanLayoutBox
Returns
A new instance of SpanLayoutBox representing the layout of the specified document element.
GetPositionHandler()
Gets the position of the layout box.
Declaration
public override PositionHandler GetPositionHandler()
Returns
The position of the layout box as a PositionHandler object.
Overrides
InvalidateTextMeasure()
Invalidates the text measurement for the current SpanLayoutBox, forcing a recalculation of the text layout measurements the next time they are needed.
Declaration
public void InvalidateTextMeasure()
IsWordStart()
Determines whether the current layout box marks the start of a word.
MeasureOverride(SizeF)
Measures the space required by the LayoutElement Used by the layout system.
Declaration
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters
availableSize
The size that is available to the LayoutElement. The available size can be infinity (to take the full size of the element)
Returns
The minimum size required by the element to be completely visible. Cannot be infinity.
Overrides
Remarks
In this method call to the Measure method of each child must be made.
MeasureTextOverride(SubStringPosition)
Declaration
protected virtual BoxMeasurementInfo MeasureTextOverride(SubStringPosition subStringPosition = 0)
Parameters
subStringPosition
SubStringPosition
Returns
MergeWithNext(LayoutBox)
Merges the current span layout box with the next layout box if applicable.
Declaration
public override void MergeWithNext(LayoutBox nextSpanBox)
Parameters
nextSpanBox
The layout box to merge with the current span layout box.
Overrides
OnAssociateDocumentElementChanged()
Declaration
protected override void OnAssociateDocumentElementChanged()
Overrides
OnPropertyChanged(string)
Declaration
protected virtual void OnPropertyChanged(string propName)
Parameters
propName
SplitSpanByIndex(int, bool)
Splits the span at the specified index, creating two separate spans.
ToString()
Returns a string representation of the current instance of the SpanLayoutBox.
Declaration
public override string ToString()
Returns
A string that represents the current SpanLayoutBox object.
Overrides
Update(string)
Updates the span layout box with the specified string value.
Declaration
public void Update(string text)
Parameters
text
The string value used to update the span layout box.
Events
PropertyChanged
Declaration
public event PropertyChangedEventHandler PropertyChanged
Event Value
Implements