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

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:

C#
public class SpanLayoutBox : InlineLayoutBox, INotifyPropertyChanged

Inheritance: objectLayoutElementLayoutBoxInlineLayoutBoxSpanLayoutBox

Derived Classes: FormattingSymbolLayoutBox

Implements: INotifyPropertyChanged

Inherited Members InlineLayoutBox.Remove()InlineLayoutBox.LineInfoInlineLayoutBox.LineSegmentInfoInlineLayoutBox.IsRtlInlineLayoutBox.AssociatedInlineInlineLayoutBox.IsStartOfLineSegmentLayoutBox.currentYLayoutBox.AssociatedLayoutBoxPropertyLayoutBox.NodeLayoutBox.GetAssociatedLayoutBox(UIElement)LayoutBox.SetAssociatedLayoutBox(UIElement, LayoutBox)LayoutBox.OnElementStructureChanging()LayoutBox.OnElementStructureChanged()LayoutBox.CreateChildrenCollection(DocumentStructureCollection)LayoutBox.InvalidateMeasureUpToTheRoot()LayoutBox.InvalidateMeasureUpToTheRootStable()LayoutBox.InvalidateArrangeUpToTheRoot()LayoutBox.InvalidateLayoutAfterEdit()LayoutBox.ValidateChild(LayoutBox)LayoutBox.GetRootDocument()LayoutBox.CanGrowVerticallyOverride(float)LayoutBox.CanGrowVertically(float)LayoutBox.GetBoxDesiredGrow()LayoutBox.CreateNewFragment(LayoutBox)LayoutBox.InvalidateMeasure()LayoutBox.IsRemovedLayoutBox.IsFragmentLayoutBox.AssociatedDocumentElementLayoutBox.ChildLayoutBoxesLayoutBox.HasVisualRepresentationLayoutBox.IsFormattingSymbolLayoutBox.BoundsChildBoxesLayoutBox.IsFirstBoxLayoutBox.IsLastBoxLayoutBox.IsFirstChildLayoutBox.IsLastChildLayoutBox.IsValidPositionLayoutBox.ParentLayoutBox.ChildIndexLayoutBox.BoundingRectangleLayoutBox.ElementStructureChangingLayoutBox.ElementStructureChangedLayoutElement.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.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 SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, bool isFragment)
Parameters:parentElementDocumentElementcollectionDocumentStructureCollectionisFragmentbool
C#
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)
Parameters:parentElementDocumentElementcollectionDocumentStructureCollectiontextstring
C#
public SpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection)
Parameters:parentElementDocumentElementcollectionDocumentStructureCollection

Properties

Gets or sets the associated span for the SpanLayoutBox.

C#
public Span AssociatedSpan { get; set; }

Gets the baseline offset of the span layout box, which indicates the distance from the top of the box to its baseline.

C#
public override float BaselineOffset { get; }

Overrides: InlineLayoutBox.BaselineOffset

C#
protected override bool CanCreateLayoutBoxesFromContent { get; }

Overrides: LayoutBox.CanCreateLayoutBoxesFromContent

Gets the desired size of the text within the SpanLayoutBox.

C#
public SizeF DesiredTextSize { get; }

Indicates whether the layout box has a defined width at the end of the line.

C#
public override bool HasWidthAtTheEndOfLine { get; }

Overrides: InlineLayoutBox.HasWidthAtTheEndOfLine

Indicates whether the span layout box is a container box.

C#
public override bool IsContainerBox { get; }

Overrides: InlineLayoutBox.IsContainerBox

Gets a value indicating whether the current SpanLayoutBox represents a decimal number.

C#
public bool IsDecimal { get; set; }

Gets a value indicating whether the current layout box represents a paragraph symbol.

C#
public bool IsParagraphSymbol { get; }

Gets or sets a value indicating whether the layout box is in a read-only state.

C#
public override bool IsReadonly { get; }

Overrides: InlineLayoutBox.IsReadonly

Gets or sets a value indicating whether the span layout box can be split.

C#
public override bool IsSplittable { get; }
Property Value:

true if the span layout box is splitable; otherwise, false.

Overrides: InlineLayoutBox.IsSplittable

Gets the number of positions within the layout box.

C#
public override int PositionsCountInBox { get; }

Overrides: InlineLayoutBox.PositionsCountInBox

Gets or sets the text content of the SpanLayoutBox.

C#
public override string Text { get; set; }

Overrides: InlineLayoutBox.Text

Methods

Determines whether the specified string contains a formatting symbol.

C#
public static bool ContainsFormattingSymbol(string text)
Parameters:textstring

The string to be checked for formatting symbols.

Returns:

bool

true if the string contains a formatting symbol; otherwise, false.

Creates a layout element from the current span layout box.

C#
public override LayoutElement CreateLayoutElement()
Returns:

LayoutElement

A new layout element that represents the span layout box.

Overrides: LayoutBox.CreateLayoutElement()

Creates a new fragment with the specified height and visibility status.

C#
public override LayoutBox CreateNewFragment(float availableWidth, bool isFirstBoxInLine)
Parameters:availableWidthfloat

The available width for the new fragment.

isFirstBoxInLinebool

A boolean indicating whether this is the first box in the current line

Returns:

LayoutBox

A new instance of the LayoutBox class representing the created fragment.

Overrides: InlineLayoutBox.CreateNewFragment(float, bool)

Creates a new instance of SpanLayoutBox for the specified document element using the provided document structure collection and text.

C#
public static SpanLayoutBox CreateSpanLayoutBox(DocumentElement parentElement, DocumentStructureCollection collection, string text)
Parameters:parentElementDocumentElement

The document element for which the span layout box is being created.

collectionDocumentStructureCollection

A collection of document structures related to the layout.

textstring

The text in the current SpanLayoutBox

Returns:

SpanLayoutBox

A new instance of SpanLayoutBox representing the layout of the specified document element.

Gets the position of the layout box.

C#
public override PositionHandler GetPositionHandler()
Returns:

PositionHandler

The position of the layout box as a PositionHandler object.

Overrides: InlineLayoutBox.GetPositionHandler()

Invalidates the text measurement for the current SpanLayoutBox, forcing a recalculation of the text layout measurements the next time they are needed.

C#
public void InvalidateTextMeasure()

Determines whether the current layout box marks the start of a word.

C#
public bool IsWordStart()
Returns:

bool

Measures the space required by the LayoutElement Used by the layout system.

C#
protected override SizeF MeasureOverride(SizeF availableSize)
Parameters:availableSizeSizeF

The size that is available to the LayoutElement. The available size can be infinity (to take the full size of the element)

Returns:

SizeF

The minimum size required by the element to be completely visible. Cannot be infinity.

Overrides: LayoutElement.MeasureOverride(SizeF)

Remarks:

In this method call to the Measure method of each child must be made.

C#
protected virtual BoxMeasurementInfo MeasureTextOverride(SubStringPosition subStringPosition = 0)
Parameters:subStringPositionSubStringPositionReturns:

BoxMeasurementInfo

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

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

The layout box to merge with the current span layout box.

Overrides: InlineLayoutBox.MergeWithNext(LayoutBox)

C#
protected override void OnAssociateDocumentElementChanged()

Overrides: LayoutBox.OnAssociateDocumentElementChanged()

C#
protected virtual void OnPropertyChanged(string propName)
Parameters:propNamestring

Splits the span at the specified index, creating two separate spans.

C#
public void SplitSpanByIndex(int splitIndex, bool isBefore)
Parameters:splitIndexint

The index at which to split the span.

isBeforebool

A boolean value indicating whether to take the text before or after the index

Returns a string representation of the current instance of the SpanLayoutBox.

C#
public override string ToString()
Returns:

string

A string that represents the current SpanLayoutBox object.

Overrides: LayoutBox.ToString()

Updates the span layout box with the specified string value.

C#
public void Update(string text)
Parameters:textstring

The string value used to update the span layout box.

Events

C#
public event PropertyChangedEventHandler PropertyChanged

Implements: INotifyPropertyChanged.PropertyChanged