Show / Hide Table of Contents

Class TextElement

An abstract class used as the base class for the abstract Block and Inline classes.

Inheritance
System.Object
DependencyObject
UIElement
TextElement
Block
Inline
Inherited Members
UIElement.TransformToVisual(UIElement)
UIElement.OnCreateAutomationPeer()
UIElement.RenderSize
UIElement.DesiredSize
UIElement.InvalidateMeasure()
UIElement.InvalidateArrange()
UIElement.Measure(Size)
UIElement.Arrange(Rect)
UIElement.UpdateLayout()
UIElement.DragEnter
UIElement.DragLeave
UIElement.Drop
UIElement.DragOver
UIElement.CacheMode
UIElement.CacheModeProperty
UIElement.Projection
UIElement.ProjectionProperty
UIElement.VisualParent
UIElement.GetVisualChild(Int32)
UIElement.VisualChildrenCount
UIElement.AddVisualChild(UIElement)
UIElement.RemoveVisualChild(UIElement)
UIElement.OnVisualChildrenChanged(DependencyObject, DependencyObject)
UIElement.XamlSourcePath
UIElement.ClipToBounds
UIElement.ClipToBoundsProperty
UIElement.ClipProperty
UIElement.Clip
UIElement.IsEnabledProperty
UIElement.IsEnabled
UIElement.IsEnabledChanged
UIElement.ManageIsEnabled(Boolean)
UIElement.EffectProperty
UIElement.Effect
UIElement.RenderTransformProperty
UIElement.RenderTransform
UIElement.RenderTransformOriginProperty
UIElement.RenderTransformOrigin
UIElement.UseLayoutRounding
UIElement.UseLayoutRoundingProperty
UIElement.Visibility
UIElement.VisibilityProperty
UIElement.IsVisibleProperty
UIElement.IsVisible
UIElement.IsVisibleChanged
UIElement.OpacityProperty
UIElement.Opacity
UIElement.OpacityMaskProperty
UIElement.OpacityMask
UIElement.IsHitTestVisible
UIElement.IsHitTestVisibleProperty
UIElement.AllowDrop
UIElement.AllowDropProperty
UIElement.CaptureMouse()
UIElement.IsMouseCaptured
UIElement.ReleaseMouseCapture()
UIElement.AllowScrollOnTouchMove
UIElement.AllowScrollOnTouchMoveProperty
UIElement.AddHandler(RoutedEvent, Delegate, Boolean)
UIElement.RemoveHandler(RoutedEvent, Delegate)
UIElement.MouseMoveEvent
UIElement.MouseMove
UIElement.OnMouseMove(MouseEventArgs)
UIElement.MouseLeftButtonDownEvent
UIElement.MouseLeftButtonDown
UIElement.OnMouseLeftButtonDown(MouseButtonEventArgs)
UIElement.MouseRightButtonDownEvent
UIElement.MouseRightButtonDown
UIElement.OnMouseRightButtonDown(MouseButtonEventArgs)
UIElement.MouseWheelEvent
UIElement.MouseWheel
UIElement.OnMouseWheel(MouseWheelEventArgs)
UIElement.MouseLeftButtonUpEvent
UIElement.MouseLeftButtonUp
UIElement.OnMouseLeftButtonUp(MouseButtonEventArgs)
UIElement.MouseEnterEvent
UIElement.MouseEnter
UIElement.OnMouseEnter(MouseEventArgs)
UIElement.MouseLeaveEvent
UIElement.MouseLeave
UIElement.OnMouseLeave(MouseEventArgs)
UIElement.TextInputStartEvent
UIElement.TextInputStart
UIElement.OnTextInputStart(TextCompositionEventArgs)
UIElement.TextInputEvent
UIElement.TextInput
UIElement.OnTextInput(TextCompositionEventArgs)
UIElement.TextInputUpdateEvent
UIElement.TextInputUpdate
UIElement.TappedEvent
UIElement.Tapped
UIElement.OnTapped(TappedRoutedEventArgs)
UIElement.MouseRightButtonUpEvent
UIElement.MouseRightButtonUp
UIElement.OnMouseRightButtonUp(MouseButtonEventArgs)
UIElement.KeyDownEvent
UIElement.KeyDown
UIElement.OnKeyDown(KeyEventArgs)
UIElement.KeyUpEvent
UIElement.KeyUp
UIElement.OnKeyUp(KeyEventArgs)
UIElement.GotFocusEvent
UIElement.GotFocus
UIElement.OnGotFocus(RoutedEventArgs)
UIElement.LostFocusEvent
UIElement.LostFocus
UIElement.OnLostFocus(RoutedEventArgs)
UIElement.LostMouseCapture
UIElement.OnLostMouseCapture(MouseEventArgs)
UIElement.INTERNAL_AttachToDomEvents()
UIElement.INTERNAL_DetachFromDomEvents()
DependencyObject.GetValue(DependencyProperty)
DependencyObject.SetCurrentValue(DependencyProperty, Object)
DependencyObject.ReadLocalValue(DependencyProperty)
DependencyObject.SetValue(DependencyProperty, Object)
DependencyObject.SetValue(DependencyPropertyKey, Object)
DependencyObject.CoerceValue(DependencyProperty)
DependencyObject.Dispatcher
DependencyObject.INTERNAL_OnAttachedToVisualTree()
DependencyObject.INTERNAL_OnDetachedFromVisualTree()
DependencyObject.ClearValue(DependencyProperty)
DependencyObject.ClearValue(DependencyPropertyKey)
DependencyObject.CheckAccess()
DependencyObject.GetAnimationBaseValue(DependencyProperty)
System.Object.Equals(System.Object)
System.Object.Equals(System.Object, System.Object)
System.Object.GetHashCode()
System.Object.GetType()
System.Object.MemberwiseClone()
System.Object.ReferenceEquals(System.Object, System.Object)
System.Object.ToString()
Namespace: System.Windows.Documents
Assembly: OpenSilver.dll
Syntax
public abstract class TextElement : UIElement, IUIElement, IDependencyObject

Constructors

| Improve this Doc View Source

TextElement()

Initializes a new instance of the TextElement class.

Declaration
protected TextElement()

Fields

| Improve this Doc View Source

CharacterSpacingProperty

Identifies the CharacterSpacing dependency property.

Declaration
public static readonly DependencyProperty CharacterSpacingProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

FontFamilyProperty

Identifies the FontFamily dependency property.

Declaration
public static readonly DependencyProperty FontFamilyProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

FontSizeProperty

Identifies the FontSize dependency property.

Declaration
public static readonly DependencyProperty FontSizeProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

FontStretchProperty

Identifies the FontStretch dependency property.

Declaration
[NotImplemented]
public static readonly DependencyProperty FontStretchProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

FontStyleProperty

Identifies the FontStyle dependency property.

Declaration
public static readonly DependencyProperty FontStyleProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

FontWeightProperty

Identifies the FontWeight dependency property.

Declaration
public static readonly DependencyProperty FontWeightProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

ForegroundProperty

Identifies the Foreground dependency property.

Declaration
public static readonly DependencyProperty ForegroundProperty
Field Value
Type Description
DependencyProperty
| Improve this Doc View Source

LanguageProperty

Identifies the Language dependency property.

Declaration
public static readonly DependencyProperty LanguageProperty
Field Value
Type Description
DependencyProperty

Properties

| Improve this Doc View Source

CharacterSpacing

Gets or sets the distance between characters of text in the control measured in 1000ths of the font size.

Declaration
public int CharacterSpacing { get; set; }
Property Value
Type Description
System.Int32

The distance between characters of text in the control measured in 1000ths of the font size. The default is 0.

| Improve this Doc View Source

ContentEnd

Gets a TextPointer that represents the end of the content in the element.

Declaration
[NotImplemented]
public TextPointer ContentEnd { get; }
Property Value
Type Description
TextPointer

A TextPointer that represents the end of the content in the TextElement.

| Improve this Doc View Source

ContentStart

Gets a TextPointer that represents the start of content in the element.

Declaration
[NotImplemented]
public TextPointer ContentStart { get; }
Property Value
Type Description
TextPointer

A TextPointer that represents the start of the content in the TextElement.

| Improve this Doc View Source

ElementEnd

Gets a TextPointer that represents the position just after the end of the element.

Declaration
[NotImplemented]
public TextPointer ElementEnd { get; }
Property Value
Type Description
TextPointer

A TextPointer that represents the position just after the end of the TextElement.

| Improve this Doc View Source

ElementStart

Gets a TextPointer that represents the position just before the start of the element.

Declaration
[NotImplemented]
public TextPointer ElementStart { get; }
Property Value
Type Description
TextPointer

A TextPointer that represents the position just before the start of the TextElement.

| Improve this Doc View Source

FontFamily

Gets or sets the preferred top-level font family for the content of the element.

Declaration
public FontFamily FontFamily { get; set; }
Property Value
Type Description
FontFamily

The preferred font family, or a primary preferred font family with one or more fallback font families. See FontFamily for default information.

| Improve this Doc View Source

FontSize

Gets or sets the font size for the content of the element.

Declaration
public double FontSize { get; set; }
Property Value
Type Description
System.Double

The desired font size in pixels. The default is 11 pixels.

| Improve this Doc View Source

FontStretch

Gets or sets the glyph width of the font in a family to select.

Declaration
[NotImplemented]
public FontStretch FontStretch { get; set; }
Property Value
Type Description
FontStretch

One of the FontStretches property values, specifying the desired font stretch. The default is Normal.

| Improve this Doc View Source

FontStyle

Gets or sets the font style for the content in this element.

Declaration
public FontStyle FontStyle { get; set; }
Property Value
Type Description
FontStyle

One of the FontStyles property values, specifying the font style. The default is Normal.

| Improve this Doc View Source

FontWeight

Gets or sets the top-level font weight to select from the font family for the content in this element.

Declaration
public FontWeight FontWeight { get; set; }
Property Value
Type Description
FontWeight

One of the FontWeights property values, specifying the font weight. The default is Normal.

| Improve this Doc View Source

Foreground

Gets or sets the Brush to apply to the content in this element.

Declaration
public Brush Foreground { get; set; }
Property Value
Type Description
Brush

The brush that is applied to the text contents. The default is a SolidColorBrush with Color value Black.

| Improve this Doc View Source

Language

Gets or sets the language of the content within an TextElement element.

Declaration
public XmlLanguage Language { get; set; }
Property Value
Type Description
XmlLanguage

A value of type XmlLanguage. The default is a XmlLanguage value created with the string en-US (IetfLanguageTag is "en-US").

| Improve this Doc View Source

Name

Gets or sets a unique identification for the object.

Declaration
public string Name { get; set; }
Property Value
Type Description
System.String

The unique identifier for the object.

Methods

| Improve this Doc View Source

CreateDomElement(Object, out Object)

Declaration
public override object CreateDomElement(object parentRef, out object domElementWhereToPlaceChildren)
Parameters
Type Name Description
System.Object parentRef
System.Object domElementWhereToPlaceChildren
Returns
Type Description
System.Object
Overrides
UIElement.CreateDomElement(Object, out Object)
| Improve this Doc View Source

FindName(String)

Gets an object in the Silverlight object model by referencing the object's x:Name or Name attribute value.

Declaration
public object FindName(string name)
Parameters
Type Name Description
System.String name

The name of the object to retrieve.

Returns
Type Description
System.Object

The object that has the specified name, or null if no object is retrieved.

| Improve this Doc View Source

GetCharacterSpacing(DependencyObject)

Returns the value of the CharacterSpacing attached property for a specified dependency object.

Declaration
public static int GetCharacterSpacing(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to retrieve the value of the CharacterSpacing property.

Returns
Type Description
System.Int32

The current value of the CharacterSpacing attached property on the specified dependency object.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

GetFontFamily(DependencyObject)

Returns the value of the FontFamily attached property for a specified dependency object.

Declaration
public static FontFamily GetFontFamily(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to retrieve the value of the FontFamily property.

Returns
Type Description
FontFamily

The current value of the FontFamily attached property on the specified dependency object.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

GetFontSize(DependencyObject)

Returns the value of the FontSize attached property for a specified dependency object.

Declaration
public static double GetFontSize(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to retrieve the value of the FontSize property.

Returns
Type Description
System.Double

The current value of the FontSize attached property on the specified dependency object.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

GetFontStretch(DependencyObject)

Returns the value of the FontStretch attached property for a specified dependency object.

Declaration
[NotImplemented]
public static FontStretch GetFontStretch(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to retrieve the value of the FontStretch property.

Returns
Type Description
FontStretch

The current value of the FontStretch attached property on the specified dependency object.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

GetFontStyle(DependencyObject)

Returns the value of the FontStyle attached property for a specified dependency object.

Declaration
public static FontStyle GetFontStyle(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to retrieve the value of the FontStyle property.

Returns
Type Description
FontStyle

The current value of the FontStyle attached property on the specified dependency object.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

GetFontWeight(DependencyObject)

Returns the value of the FontWeight attached property for a specified dependency object.

Declaration
public static FontWeight GetFontWeight(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to retrieve the value of the FontWeight property.

Returns
Type Description
FontWeight

The current value of the FontWeight attached property on the specified dependency object.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

GetForeground(DependencyObject)

Returns the value of the Foreground attached property for a specified dependency object.

Declaration
public static Brush GetForeground(DependencyObject element)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to retrieve the value of the Foreground property.

Returns
Type Description
Brush

The current value of the Foreground attached property on the specified dependency object.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

OnPropertyChanged(DependencyPropertyChangedEventArgs)

Invoked whenever the effective value of any dependency property on this DependencyObject has been updated. The specific dependency property that changed is reported in the event data.

Declaration
protected override void OnPropertyChanged(DependencyPropertyChangedEventArgs e)
Parameters
Type Name Description
DependencyPropertyChangedEventArgs e

Event data that will contain the dependency property identifier of interest, the property metadata for the type, and old and new values.

Overrides
UIElement.OnPropertyChanged(DependencyPropertyChangedEventArgs)
| Improve this Doc View Source

OnVisualParentChanged(DependencyObject)

Declaration
protected override void OnVisualParentChanged(DependencyObject oldParent)
Parameters
Type Name Description
DependencyObject oldParent
Overrides
UIElement.OnVisualParentChanged(DependencyObject)
| Improve this Doc View Source

SetCharacterSpacing(DependencyObject, Int32)

Sets the value of the CharacterSpacing attached property for a specified dependency object.

Declaration
public static void SetCharacterSpacing(DependencyObject element, int value)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to set the value of the CharacterSpacing property.

System.Int32 value

The new value to set the property to.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

SetFontFamily(DependencyObject, FontFamily)

Sets the value of the FontFamily attached property for a specified dependency object.

Declaration
public static void SetFontFamily(DependencyObject element, FontFamily value)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to set the value of the FontFamily property.

FontFamily value

The new value to set the property to.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

SetFontSize(DependencyObject, Double)

Sets the value of the FontSize attached property for a specified dependency object.

Declaration
public static void SetFontSize(DependencyObject element, double value)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to set the value of the FontSize property.

System.Double value

The new value to set the property to.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

SetFontStretch(DependencyObject, FontStretch)

Sets the value of the FontStretch attached property for a specified dependency object.

Declaration
[NotImplemented]
public static void SetFontStretch(DependencyObject element, FontStretch value)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to set the value of the FontStretch property.

FontStretch value

The new value to set the property to.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

SetFontStyle(DependencyObject, FontStyle)

Sets the value of the FontStyle attached property for a specified dependency object.

Declaration
public static void SetFontStyle(DependencyObject element, FontStyle value)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to set the value of the FontStyle property.

FontStyle value

The new value to set the property to.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

SetFontWeight(DependencyObject, FontWeight)

Sets the value of the FontWeight attached property for a specified dependency object.

Declaration
public static void SetFontWeight(DependencyObject element, FontWeight value)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to set the value of the FontWeight property.

FontWeight value

The new value to set the property to.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

| Improve this Doc View Source

SetForeground(DependencyObject, Brush)

Sets the value of the Foreground attached property for a specified dependency object.

Declaration
public static void SetForeground(DependencyObject element, Brush value)
Parameters
Type Name Description
DependencyObject element

The dependency object for which to set the value of the Foreground property.

Brush value

The new value to set the property to.

Exceptions
Type Condition
System.ArgumentNullException

element is null.

Extension Methods

DependencyObjectHelper.GetSelfAndAncestors(DependencyObject)
UIElementExtendedRoutedEventExtensions.AddHandler(UIElement, ExtendedRoutedEvent, Delegate, Boolean)
UIElementExtendedRoutedEventExtensions.RemoveHandler(UIElement, ExtendedRoutedEvent, Delegate)
VisualTreeExtensions.GetVisualAncestors(DependencyObject)
VisualTreeExtensions.GetVisualAncestorsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualChildren(DependencyObject)
VisualTreeExtensions.GetVisualChildrenAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualDescendants(DependencyObject)
VisualTreeExtensions.GetVisualDescendantsAndSelf(DependencyObject)
VisualTreeExtensions.GetVisualSiblings(DependencyObject)
VisualTreeExtensions.GetVisualSiblingsAndSelf(DependencyObject)
  • Improve this Doc
  • View Source