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 jQuery UI for Angular UI for React UI for Vue UI for Blazor UI for ASP.NET Core UI for ASP.NET MVC UI for ASP.NET AJAX

    Mobile

    UI for .NET MAUI UI for Xamarin

    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 Test Studio Dev Edition Telerik JustMock

    CMS

    Sitefinity

    UI/UX Tools

    ThemeBuilder Design System Kit Templates and Building Blocks

    Debugging

    Fiddler Fiddler Everywhere Fiddler Classic Fiddler Everywhere Reporter FiddlerCore

    Free Tools

    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 and Security
    • 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 Span

Inheritance
System.Object
DocumentElement
Inline
Span
Break
Inherited Members
Inline.CopyContentFrom(DocumentElement)
Inline.FieldStart
Inline.IsCopyable
DocumentElement.GetStyleProperty(IStylePropertyDefinition)
DocumentElement.GetStyleProperty(String)
DocumentElement.EnumerateChildrenOfType<T>()
DocumentElement.GetParentOfType<T>()
DocumentElement.CreateLayoutBox()
DocumentElement.CopyPropertiesFrom(DocumentElement)
DocumentElement.CopyPropertiesFromStyle(StyleDefinition)
DocumentElement.ExtractStyleFromProperties()
DocumentElement.ExtractStyleFromLocalProperties()
DocumentElement.InvalidateAssociatedBoxesArrange()
DocumentElement.InvalidateAssociatedBoxesMeasure()
DocumentElement.InvalidateAssociatedBoxesLayout()
DocumentElement.GetAssociatedLayoutBoxes()
DocumentElement.GetRootDocument()
DocumentElement.CreateDeepCopy()
DocumentElement.CreateShallowCopy()
DocumentElement.GetPropertyValueSource(IStylePropertyDefinition)
DocumentElement.ClearValue(IStylePropertyDefinition)
DocumentElement.OnRemoved()
DocumentElement.OnStyleChanging()
DocumentElement.OnStyleChanged()
DocumentElement.add_StylePropertyChanged(StylePropertyChangeEventHandler)
DocumentElement.remove_StylePropertyChanged(StylePropertyChangeEventHandler)
DocumentElement.OnStylePropertyChanged(StylePropertyChangeEventArgs)
DocumentElement.OnParentChanging()
DocumentElement.OnParentChanged()
DocumentElement.add_PropertyValueChanged(StylePropertyChangeEventHandler)
DocumentElement.remove_PropertyValueChanged(StylePropertyChangeEventHandler)
DocumentElement.ChildIndex
DocumentElement.HasStyle
DocumentElement.Style
DocumentElement.StyleName
DocumentElement.FirstLayoutBox
DocumentElement.LastLayoutBox
DocumentElement.IsFirstLayoutBoxInitialized
DocumentElement.DocumentElements
DocumentElement.Parent
DocumentElement.Children
DocumentElement.PreviousSibling
DocumentElement.NextSibling
DocumentElement.OriginalProperties
DocumentElement.RevisionInfo
DocumentElement.StyleChanging
DocumentElement.StyleChanged
DocumentElement.StylePropertyChanged
DocumentElement.ParentChanging
DocumentElement.ParentChanged
DocumentElement.PropertyValueChanged
Namespace: Telerik.Windows.Documents.Model
Assembly: Telerik.Windows.Controls.RichTextBox.dll

Syntax

public class Span : Inline

Constructors

Span()

Initializes a new instance of the Span class.

Declaration
public Span()

Span(String)

Initializes a new instance of the Span class with applied text.

Declaration
public Span(string text)
Parameters
System.String text

The text content of the span.

Span(Span)

Initializes a new instance of the Span class. Creates a copy of an existing Span.

Declaration
public Span(Span originalSpan)
Parameters
Span originalSpan

The original span.

Fields

BaselineAlignmentProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<BaselineAlignment>, SpanProperties> BaselineAlignmentProperty
Field Value
StylePropertyDefinition<System.Nullable<BaselineAlignment>, SpanProperties>

FlowDirectionProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<FlowDirection>, SpanProperties> FlowDirectionProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Windows.FlowDirection>, SpanProperties>

FontFamilyProperty

Declaration
public static readonly StylePropertyDefinition<FontFamily, SpanProperties> FontFamilyProperty
Field Value
StylePropertyDefinition<System.Windows.Media.FontFamily, SpanProperties>

FontSizeProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<double>, SpanProperties> FontSizeProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Double>, SpanProperties>

FontStyleProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<FontStyle>, SpanProperties> FontStyleProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Windows.FontStyle>, SpanProperties>

FontWeightProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<FontWeight>, SpanProperties> FontWeightProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Windows.FontWeight>, SpanProperties>

ForeColorProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<Color>, SpanProperties> ForeColorProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Windows.Media.Color>, SpanProperties>

HighlightColorProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<Color>, SpanProperties> HighlightColorProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Windows.Media.Color>, SpanProperties>

StrikethroughProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<bool>, SpanProperties> StrikethroughProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Boolean>, SpanProperties>

TagProperty

Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> TagProperty
Field Value
StylePropertyDefinition<System.String, SpanProperties>

ThemeFontFamilyProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<ThemeFontsEnum>, SpanProperties> ThemeFontFamilyProperty
Field Value
StylePropertyDefinition<System.Nullable<ThemeFontsEnum>, SpanProperties>

ThemeForeColorProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<ThemeColorsEnum>, SpanProperties> ThemeForeColorProperty
Field Value
StylePropertyDefinition<System.Nullable<ThemeColorsEnum>, SpanProperties>

ThemeForeColorShadeProperty

Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeForeColorShadeProperty
Field Value
StylePropertyDefinition<System.String, SpanProperties>

ThemeForeColorTintProperty

Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeForeColorTintProperty
Field Value
StylePropertyDefinition<System.String, SpanProperties>

ThemeUnderlineColorProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<ThemeColorsEnum>, SpanProperties> ThemeUnderlineColorProperty
Field Value
StylePropertyDefinition<System.Nullable<ThemeColorsEnum>, SpanProperties>

ThemeUnderlineColorShadeProperty

Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeUnderlineColorShadeProperty
Field Value
StylePropertyDefinition<System.String, SpanProperties>

ThemeUnderlineColorTintProperty

Declaration
public static readonly StylePropertyDefinition<string, SpanProperties> ThemeUnderlineColorTintProperty
Field Value
StylePropertyDefinition<System.String, SpanProperties>

UnderlineColorProperty

Declaration
public static readonly StylePropertyDefinition<Nullable<Color>, SpanProperties> UnderlineColorProperty
Field Value
StylePropertyDefinition<System.Nullable<System.Windows.Media.Color>, SpanProperties>

UnderlineDecorationProperty

Declaration
public static readonly StylePropertyDefinition<IUnderlineUIDecorationProvider, SpanProperties> UnderlineDecorationProperty
Field Value
StylePropertyDefinition<IUnderlineUIDecorationProvider, SpanProperties>

Properties

BaselineAlignment

Gets or sets the baseline alignment.

Declaration
[XamlSerializable]
public BaselineAlignment BaselineAlignment { get; set; }
Property Value
BaselineAlignment

The baseline alignment.

Cursor

Gets or sets the cursor type depending on the specific element inside the span.

Declaration
public override Cursor Cursor { get; set; }
Property Value
System.Windows.Input.Cursor

An instance of Cursor determining the cursor representation.

Overrides
DocumentElement.Cursor

FlowDirection

Gets or sets the flow direction.

Declaration
[XamlSerializable]
public FlowDirection FlowDirection { get; set; }
Property Value
System.Windows.FlowDirection

The flow direction.

FontFamily

Gets or sets the font family of the content.

Declaration
[XamlSerializable]
public FontFamily FontFamily { get; set; }
Property Value
System.Windows.Media.FontFamily

The font family.

FontSize

Gets or sets the size of the font. The value is in Device Independent Pixels.

Declaration
[XamlSerializable]
public double FontSize { get; set; }
Property Value
System.Double

The size of the font.

FontStyle

Gets or sets the font style.

Declaration
[XamlSerializable]
public FontStyle FontStyle { get; set; }
Property Value
System.Windows.FontStyle

The font style.

FontWeight

Gets or sets the font weight.

Declaration
[XamlSerializable]
public FontWeight FontWeight { get; set; }
Property Value
System.Windows.FontWeight

The font weight.

ForeColor

Gets or sets the fore color.

Declaration
[XamlSerializable]
public Color ForeColor { get; set; }
Property Value
System.Windows.Media.Color

The color.

HighlightColor

Gets or sets the color of the highlight.

Declaration
[XamlSerializable]
public Color HighlightColor { get; set; }
Property Value
System.Windows.Media.Color

The color.

Strikethrough

Gets or sets a value indicating whether this Span has a strike-through applied.

Declaration
[XamlSerializable]
public bool Strikethrough { get; set; }
Property Value
System.Boolean

true if strike-through is applied; otherwise, false.

Tag

String property that allows developers to attach custom data to the DocumentElement. The value of this property will be copied to DocumentElements created out of this DocumentElement during editing.

Declaration
[XamlSerializable("")]
public override string Tag { get; set; }
Property Value
System.String

Overrides
DocumentElement.Tag

Text

Gets or sets the text of the span.

Declaration
[XamlSerializable]
public string Text { get; set; }
Property Value
System.String

The text.

ThemeFontFamily

Gets or sets the theme font family.

Declaration
[XamlSerializable]
public ThemeFontsEnum ThemeFontFamily { get; set; }
Property Value
ThemeFontsEnum

The theme font family.

ThemeForeColor

Gets or sets the theme fore color.

Declaration
[XamlSerializable]
public ThemeColorsEnum ThemeForeColor { get; set; }
Property Value
ThemeColorsEnum

The color.

ThemeForeColorShade

Gets or sets the theme fore color shade.

Declaration
[XamlSerializable]
public string ThemeForeColorShade { get; set; }
Property Value
System.String

The theme fore color shade.

ThemeForeColorTint

Gets or sets the theme fore color tint.

Declaration
[XamlSerializable]
public string ThemeForeColorTint { get; set; }
Property Value
System.String

The theme fore color tint.

ThemeUnderlineColor

Gets or sets the theme color of the underline decoration.

Declaration
[XamlSerializable]
public ThemeColorsEnum ThemeUnderlineColor { get; set; }
Property Value
ThemeColorsEnum

The color.

ThemeUnderlineColorShade

Gets or sets the theme underline color shade.

Declaration
[XamlSerializable]
public string ThemeUnderlineColorShade { get; set; }
Property Value
System.String

The theme underline color shade.

ThemeUnderlineColorTint

Gets or sets the theme underline color tint.

Declaration
[XamlSerializable]
public string ThemeUnderlineColorTint { get; set; }
Property Value
System.String

The theme underline color tint.

Underline

Gets a value indicating whether this Span has underline applied to it.

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

true if the content is underlined; otherwise, false.

UnderlineColor

Gets or sets the color of the underline decoration.

Declaration
[XamlSerializable]
public Color UnderlineColor { get; set; }
Property Value
System.Windows.Media.Color

The color.

UnderlineDecoration

Gets or sets the underline decoration.

Declaration
[XamlSerializable]
public IUnderlineUIDecorationProvider UnderlineDecoration { get; set; }
Property Value
IUnderlineUIDecorationProvider

The underline decoration.

Methods

AssociateBoxWithANewSpan(Span, SpanLayoutBox)

Associates the SpanLayoutBox with a new Span.

Declaration
public static bool AssociateBoxWithANewSpan(Span originalSpan, SpanLayoutBox spanLayoutBox)
Parameters
Span originalSpan

The original span.

SpanLayoutBox spanLayoutBox

The span layout box.

Returns
System.Boolean

true, if LayoutBox instances have been moved.

CalculateFinalFontSize()

Calculates the final size of the font depending on the BaselineAlignment value.

Declaration
public double CalculateFinalFontSize()
Returns
System.Double

The calculated font size.

CopyContentFromOverride(DocumentElement)

Copies the content of a Span instance to the current object.

Declaration
protected override void CopyContentFromOverride(DocumentElement fromElement)
Parameters
DocumentElement fromElement

The Span to copy the content from.

Overrides
Inline.CopyContentFromOverride(DocumentElement)

CopyFromPositionToEndOfInline(DocumentPosition, DocumentPosition)

Creates a new span which is a copy of the contents between two positions of the current Span instance.

Declaration
public override Inline CopyFromPositionToEndOfInline(DocumentPosition documentPosition, DocumentPosition endPosition)
Parameters
DocumentPosition documentPosition

The start position.

DocumentPosition endPosition

The end position.

Returns
Inline

A new Span instance keeping the content between the specified positions.

Overrides
Inline.CopyFromPositionToEndOfInline(DocumentPosition, DocumentPosition)

CopyFromStartOfInlineToEndPosition(DocumentPosition)

Creates a new span which is a copy of the contents between the start of the current instance and a specified end position.

Declaration
public override Inline CopyFromStartOfInlineToEndPosition(DocumentPosition endPosition)
Parameters
DocumentPosition endPosition

The end position.

Returns
Inline

A new Span instance keeping the contents between the start of the current instance and a specified end position.

Overrides
Inline.CopyFromStartOfInlineToEndPosition(DocumentPosition)

CopyPropertiesFromOverride(DocumentElement)

Copies the properties of a Span instance to the current object.

Declaration
protected override void CopyPropertiesFromOverride(DocumentElement fromElement)
Parameters
DocumentElement fromElement

The Span to copy the properties from.

Overrides
Inline.CopyPropertiesFromOverride(DocumentElement)

CreateLayoutBox(DocumentStructureCollection)

Creates a new SpanLayoutBox instance.

Declaration
public override LayoutBox CreateLayoutBox(DocumentStructureCollection documentCollection)
Parameters
DocumentStructureCollection documentCollection

The document collection.

Returns
LayoutBox

The new SpanLayoutBox instance.

Overrides
DocumentElement.CreateLayoutBox(DocumentStructureCollection)

CreateNewElementInstance()

Creates a new Span instance.

Declaration
protected override DocumentElement CreateNewElementInstance()
Returns
DocumentElement

The new Span instance.

Overrides
DocumentElement.CreateNewElementInstance()

HasSameStyle(Span, Boolean, Boolean)

Determines whether a Span instance has the same style applied as the current one.

Declaration
public virtual bool HasSameStyle(Span other, bool compareFlowDirection = false, bool ignoreStyle = false)
Parameters
Span other

The other.

System.Boolean compareFlowDirection

if set to true the FlowDirection is compared as well.

System.Boolean ignoreStyle

if set to true the name of the style applied to the spans is not compared.

Returns
System.Boolean

true if the current instance and the one passed as a parameter have the same style applied; otherwise, false.

Extension Methods

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.