Class TextElement
Inherited Members
Namespace: System.Windows.Documents
Assembly: OpenSilver.dll
Syntax
public abstract class TextElement : UIElement, IUIElement, IDependencyObject
Constructors
| Improve this Doc View SourceTextElement()
Initializes a new instance of the TextElement class.
Declaration
protected TextElement()
Fields
| Improve this Doc View SourceCharacterSpacingProperty
Identifies the CharacterSpacing dependency property.
Declaration
public static readonly DependencyProperty CharacterSpacingProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FontFamilyProperty
Identifies the FontFamily dependency property.
Declaration
public static readonly DependencyProperty FontFamilyProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FontSizeProperty
Identifies the FontSize dependency property.
Declaration
public static readonly DependencyProperty FontSizeProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FontStretchProperty
Identifies the FontStretch dependency property.
Declaration
[NotImplemented]
public static readonly DependencyProperty FontStretchProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FontStyleProperty
Identifies the FontStyle dependency property.
Declaration
public static readonly DependencyProperty FontStyleProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
FontWeightProperty
Identifies the FontWeight dependency property.
Declaration
public static readonly DependencyProperty FontWeightProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
ForegroundProperty
Identifies the Foreground dependency property.
Declaration
public static readonly DependencyProperty ForegroundProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
LanguageProperty
Identifies the Language dependency property.
Declaration
public static readonly DependencyProperty LanguageProperty
Field Value
Type | Description |
---|---|
DependencyProperty |
Properties
| Improve this Doc View SourceCharacterSpacing
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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"). |
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 SourceCreateDomElement(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
| Improve this Doc View SourceFindName(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. |
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. |
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. |
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. |
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. |
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. |
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. |
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. |
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
| Improve this Doc View SourceOnVisualParentChanged(DependencyObject)
Declaration
protected override void OnVisualParentChanged(DependencyObject oldParent)
Parameters
Type | Name | Description |
---|---|---|
DependencyObject | oldParent |
Overrides
| Improve this Doc View SourceSetCharacterSpacing(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. |
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. |
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. |
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. |
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. |
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. |
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. |