TextElement
TextElement
TextElement
TextElement
Class
Definition
An abstract class used as the base class for the also-abstract Block and Inline classes. TextElement supports common API for classes involved in the XAML text object model, such as properties that control text size, font families and so on.
public : class TextElement : DependencyObject, ITextElement, ITextElement2, ITextElement3, ITextElement4, ITextElementOverridespublic class TextElement : DependencyObject, ITextElement, ITextElement2, ITextElement3, ITextElement4, ITextElementOverridesPublic Class TextElement Inherits DependencyObject Implements ITextElement, ITextElement2, ITextElement3, ITextElement4, ITextElementOverrides// This API is not available in Javascript.
- Inheritance
-
TextElementTextElementTextElementTextElement
- Attributes
| Device family |
Windows 10 (introduced v10.0.10240.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v1)
|
Inherited Members
Inherited methods
Inherited properties
Remarks
The various properties defined by TextElement support a common API for classes involved in the XAML text object model. Here's a list of the most commonly used properties:
By setting TextElement properties, you can apply common text formatting properties to text, both in blocks and in inlines. There are also additional ways to format text, but these aren't directly supported by TextElement. Instead, you can use the attached properties of the Typography class. Typography attached properties typically support advanced typographic features or conventions, such as accessing typographic features defined at the font level that are not necessarily supported by all fonts. For example, you could set Typography.Variants as an attached property on any text block or inline, and this would influence the font-variants behavior as enabled by the particular font you chose for setting FontFamily on that text element.
TextElement doesn't inherently define a connection point to a XAML visual tree. In other words a TextElement defines text and text object model within that text, but it doesn't yet enable the display of that text within a UI. For that, you need to use one of the controls or elements that are descendants of UIElement and can be connected to the XAML tree and the root visual of your app window. There are two such elements in the Windows Runtime:
- TextBlock: Supports a text object model of inlines only with its Inlines collection.
- RichTextBlock: Supports a block text object model with its Blocks collection. The blocks can contain blocks and inlines.
Note
PasswordBox, RichEditBox and TextBox don't support a text object model that's based on TextElement. RichEditBox does enable programmatic access to a different text object model through the ITextDocument interface.
TextElement defines API that support examining the text object model as programming objects after the XAML is parsed. In particular TextElement implements Name and Language, which parallel properties of the same name on FrameworkElement. TextElement also implements FindName (a utility method for finding objects at run time based on how Name was set in initial XAML), and OnDisconnectVisualChildren (for advanced scenarios and designer support).
TextElement has four properties that provide access to TextPointer objects from within text. These properties are: ContentStart, ContentEnd, ElementStart, ElementEnd. A Windows Runtime TextPointer object gives you an entry point for traversal of content. For more info, see TextPointer.
TextElement is a class derived from DependencyObject. That means it can define dependency properties, and each of the read-write properties of TextElement is a dependency property, with its property identifier also defined by TextElement. For more info on what dependency properties enable, see Dependency properties overview.
TextElement derived classes
TextElement is the parent class for two derived classes that split the text object model into two text usage conventions: Block, and Inline. Block and Inline are both considered base classes (you don't typically see a <Block> tag in XAML) and exist in the hierarchy mainly to be the parent class of other practical text elements. For example, Block is the parent class of Paragraph. For more info on how to use block and inline elements, see Quickstart: Displaying text.
Properties
AccessKey AccessKey AccessKey AccessKey
Gets or sets the access key for this element.
public : PlatForm::String AccessKey { get; set; }public string AccessKey { get; set; }Public ReadWrite Property AccessKey As string// This API is not available in Javascript.
- Value
- PlatForm::String string string string
The access key for this element.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
AccessKeyProperty AccessKeyProperty AccessKeyProperty AccessKeyProperty
Identifies the AccessKey dependency property.
public : static DependencyProperty AccessKeyProperty { get; }public static DependencyProperty AccessKeyProperty { get; }Public Static ReadOnly Property AccessKeyProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the AccessKey dependency property.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner AccessKeyScopeOwner
Gets or sets a source element that provides the access key scope for this element, even if it's not in the visual tree of the source element.
public : DependencyObject AccessKeyScopeOwner { get; set; }public DependencyObject AccessKeyScopeOwner { get; set; }Public ReadWrite Property AccessKeyScopeOwner As DependencyObject// This API is not available in Javascript.
The element that defines the access key scope.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
The source element must have it's IsAccessKeyScope property set to true.
AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty AccessKeyScopeOwnerProperty
Identifies the AccessKeyScopeOwner dependency property.
public : static DependencyProperty AccessKeyScopeOwnerProperty { get; }public static DependencyProperty AccessKeyScopeOwnerProperty { get; }Public Static ReadOnly Property AccessKeyScopeOwnerProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the AccessKeyScopeOwner dependency property.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction AllowFocusOnInteraction
Gets or sets a value that indicates whether the element automatically gets focus when the user interacts with it.
public : PlatForm::Boolean AllowFocusOnInteraction { get; set; }public bool AllowFocusOnInteraction { get; set; }Public ReadWrite Property AllowFocusOnInteraction As bool// This API is not available in Javascript.
<textElementAllowFocusOnInteraction="bool"/>
- Value
- PlatForm::Boolean bool bool bool
true if the element gets focus when a user interacts with it; otherwise, false.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty AllowFocusOnInteractionProperty
Identifies the AllowFocusOnInteraction dependency property.
public : static DependencyProperty AllowFocusOnInteractionProperty { get; }public static DependencyProperty AllowFocusOnInteractionProperty { get; }Public Static ReadOnly Property AllowFocusOnInteractionProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the AllowFocusOnInteraction dependency property.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
CharacterSpacing CharacterSpacing CharacterSpacing CharacterSpacing
Gets or sets the uniform spacing between characters, in units of 1/1000 of an em.
public : int CharacterSpacing { get; set; }public int CharacterSpacing { get; set; }Public ReadWrite Property CharacterSpacing As int// This API is not available in Javascript.
<textElement CharacterSpacing="int"/>
- Value
- int int int int
The uniform spacing between characters, in units of 1/1000 of an em. The default is 0. Positive values increase tracking and loosen character spacing. Negative values decrease tracking and tighten the character spacing.
CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty CharacterSpacingProperty
Identifies the CharacterSpacing dependency property.
public : static DependencyProperty CharacterSpacingProperty { get; }public static DependencyProperty CharacterSpacingProperty { get; }Public Static ReadOnly Property CharacterSpacingProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the CharacterSpacing dependency property.
ContentEnd ContentEnd ContentEnd ContentEnd
Gets a TextPointer that represents the end of the content in the element.
public : TextPointer ContentEnd { get; }public TextPointer ContentEnd { get; }Public ReadOnly Property ContentEnd As TextPointer// This API is not available in Javascript.
A TextPointer that represents the end of the content in the TextElement.
ContentStart ContentStart ContentStart ContentStart
Gets a TextPointer that represents the start of content in the element.
public : TextPointer ContentStart { get; }public TextPointer ContentStart { get; }Public ReadOnly Property ContentStart As TextPointer// This API is not available in Javascript.
A TextPointer that represents the start of the content in the TextElement.
ElementEnd ElementEnd ElementEnd ElementEnd
Gets a TextPointer that represents the position just after the end of the element.
public : TextPointer ElementEnd { get; }public TextPointer ElementEnd { get; }Public ReadOnly Property ElementEnd As TextPointer// This API is not available in Javascript.
A TextPointer that represents the position just after the end of the TextElement.
ElementStart ElementStart ElementStart ElementStart
Gets a TextPointer that represents the position just before the start of the element.
public : TextPointer ElementStart { get; }public TextPointer ElementStart { get; }Public ReadOnly Property ElementStart As TextPointer// This API is not available in Javascript.
A TextPointer that represents the position just before the start of the TextElement.
ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked ExitDisplayModeOnAccessKeyInvoked
Gets or sets a value that specifies whether the access key display is dismissed when an access key is invoked.
public : PlatForm::Boolean ExitDisplayModeOnAccessKeyInvoked { get; set; }public bool ExitDisplayModeOnAccessKeyInvoked { get; set; }Public ReadWrite Property ExitDisplayModeOnAccessKeyInvoked As bool// This API is not available in Javascript.
- Value
- PlatForm::Boolean bool bool bool
true to dismiss the access key display when an access key is invoked; otherwise, false.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty ExitDisplayModeOnAccessKeyInvokedProperty
Identifies the ExitDisplayModeOnAccessKeyInvoked dependency property.
public : static DependencyProperty ExitDisplayModeOnAccessKeyInvokedProperty { get; }public static DependencyProperty ExitDisplayModeOnAccessKeyInvokedProperty { get; }Public Static ReadOnly Property ExitDisplayModeOnAccessKeyInvokedProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the ExitDisplayModeOnAccessKeyInvoked dependency property.
| Device family |
Windows 10 Anniversary Edition (introduced v10.0.14393.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v3)
|
FontFamily FontFamily FontFamily FontFamily
Gets or sets the preferred top-level font family for the content of the element.
public : FontFamily FontFamily { get; set; }public FontFamily FontFamily { get; set; }Public ReadWrite Property FontFamily As FontFamily// This API is not available in Javascript.
<textElement FontFamily="fontFamily" />
-or-
<textElement FontFamily="fontFamilyName[,fallbackFontFamilyName]" />
-or-
<textElement FontFamily="fontURI#fontFamily" />
The preferred font family, or a primary preferred font family with one or more fallback font families. See FontFamily for default information.
FontFamilyProperty FontFamilyProperty FontFamilyProperty FontFamilyProperty
Identifies the FontFamily dependency property.
public : static DependencyProperty FontFamilyProperty { get; }public static DependencyProperty FontFamilyProperty { get; }Public Static ReadOnly Property FontFamilyProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the FontFamily dependency property.
FontSize FontSize FontSize FontSize
Gets or sets the font size for the content of the element.
public : double FontSize { get; set; }public double FontSize { get; set; }Public ReadWrite Property FontSize As double// This API is not available in Javascript.
<textElement FontSize="double" />
- Value
- double double double double
The desired font size in pixels. The default is 11 pixels.
FontSizeProperty FontSizeProperty FontSizeProperty FontSizeProperty
Identifies the FontSize dependency property.
public : static DependencyProperty FontSizeProperty { get; }public static DependencyProperty FontSizeProperty { get; }Public Static ReadOnly Property FontSizeProperty As DependencyProperty// This API is not available in Javascript.
Identifier for the FontSize dependency property.
FontStretch FontStretch FontStretch FontStretch
Gets or sets the glyph width of the font in a family to select.
public : FontStretch FontStretch { get; set; }public FontStretch FontStretch { get; set; }Public ReadWrite Property FontStretch As FontStretch// This API is not available in Javascript.
<textElement FontStretch="fontStretchMemberName"/>
One of the FontStretch constant names, specifying the desired font stretch. The default is Normal.
FontStretchProperty FontStretchProperty FontStretchProperty FontStretchProperty
Identifies the FontStretch dependency property.
public : static DependencyProperty FontStretchProperty { get; }public static DependencyProperty FontStretchProperty { get; }Public Static ReadOnly Property FontStretchProperty As DependencyProperty// This API is not available in Javascript.
Identifier for the FontStretch dependency property.
FontStyle FontStyle FontStyle FontStyle
Gets or sets the font style for the content in this element.
public : FontStyle FontStyle { get; set; }public FontStyle FontStyle { get; set; }Public ReadWrite Property FontStyle As FontStyle// This API is not available in Javascript.
<textElement FontStyle="fontStyleMemberName"/>
FontStyleProperty FontStyleProperty FontStyleProperty FontStyleProperty
Identifies the FontStyle dependency property.
public : static DependencyProperty FontStyleProperty { get; }public static DependencyProperty FontStyleProperty { get; }Public Static ReadOnly Property FontStyleProperty As DependencyProperty// This API is not available in Javascript.
Identifier for the FontStyle dependency property.
FontWeight FontWeight FontWeight FontWeight
Gets or sets the top-level font weight to select from the font family for the content in this element.
public : FontWeight FontWeight { get; set; }public FontWeight FontWeight { get; set; }Public ReadWrite Property FontWeight As FontWeight// This API is not available in Javascript.
<textElement FontWeight="fontWeightsValue"/>
One of the FontWeights property values, specifying the font weight. The default is Normal.
FontWeightProperty FontWeightProperty FontWeightProperty FontWeightProperty
Identifies the FontWeight dependency property.
public : static DependencyProperty FontWeightProperty { get; }public static DependencyProperty FontWeightProperty { get; }Public Static ReadOnly Property FontWeightProperty As DependencyProperty// This API is not available in Javascript.
Identifier for the FontWeight dependency property.
Foreground Foreground Foreground Foreground
Gets or sets the Brush to apply to the content in this element.
public : Brush Foreground { get; set; }public Brush Foreground { get; set; }Public ReadWrite Property Foreground As Brush// This API is not available in Javascript.
<textElementForeground="{StaticResource resourceName}"/>
The brush that is applied to the text content. The default is a SolidColorBrush with Color value Black.
Remarks
Setting Foreground has no visible effect for LineBreak or InlineUIContainer objects.
- See Also
ForegroundProperty ForegroundProperty ForegroundProperty ForegroundProperty
Identifies the Foreground dependency property.
public : static DependencyProperty ForegroundProperty { get; }public static DependencyProperty ForegroundProperty { get; }Public Static ReadOnly Property ForegroundProperty As DependencyProperty// This API is not available in Javascript.
Identifier for the Foreground dependency property.
IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope IsAccessKeyScope
Gets or sets a value that indicates whether an element defines its own access key scope.
public : PlatForm::Boolean IsAccessKeyScope { get; set; }public bool IsAccessKeyScope { get; set; }Public ReadWrite Property IsAccessKeyScope As bool// This API is not available in Javascript.
- Value
- PlatForm::Boolean bool bool bool
true if an element defines its own scope; otherwise, false.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty IsAccessKeyScopeProperty
Identifies the IsAccessKeyScope dependency property.
public : static DependencyProperty IsAccessKeyScopeProperty { get; }public static DependencyProperty IsAccessKeyScopeProperty { get; }Public Static ReadOnly Property IsAccessKeyScopeProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the IsAccessKeyScope dependency property.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled IsTextScaleFactorEnabled
Gets or sets whether automatic text enlargement, to reflect the system text size setting, is enabled.
public : PlatForm::Boolean IsTextScaleFactorEnabled { get; set; }public bool IsTextScaleFactorEnabled { get; set; }Public ReadWrite Property IsTextScaleFactorEnabled As bool// This API is not available in Javascript.
<textElement IsTextScaleFactorEnabled="bool"/>
- Value
- PlatForm::Boolean bool bool bool
true if automatic text enlargement is enabled; otherwise, false.
- See Also
IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty IsTextScaleFactorEnabledProperty
Identifies the IsTextScaleFactorEnabled dependency property.
public : static DependencyProperty IsTextScaleFactorEnabledProperty { get; }public static DependencyProperty IsTextScaleFactorEnabledProperty { get; }Public Static ReadOnly Property IsTextScaleFactorEnabledProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the IsTextScaleFactorEnabled dependency property.
KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset KeyTipHorizontalOffset
Gets or sets a value that indicates how far left or right the keytip is placed in relation to the text element.
public : double KeyTipHorizontalOffset { get; set; }public double KeyTipHorizontalOffset { get; set; }Public ReadWrite Property KeyTipHorizontalOffset As double// This API is not available in Javascript.
<textElement KeyTipHorizontalOffset="double"/>
- Value
- double double double double
The number of pixels to move the KeyTip. Positive values move it right. Negative values move it left.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty KeyTipHorizontalOffsetProperty
Identifies the KeyTipHorizontalOffset dependency property.
public : static DependencyProperty KeyTipHorizontalOffsetProperty { get; }public static DependencyProperty KeyTipHorizontalOffsetProperty { get; }Public Static ReadOnly Property KeyTipHorizontalOffsetProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the KeyTipHorizontalOffset dependency property.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode KeyTipPlacementMode
Gets or sets a value that indicates where the KeyTip is placed in relation to the text element.
public : KeyTipPlacementMode KeyTipPlacementMode { get; set; }public KeyTipPlacementMode KeyTipPlacementMode { get; set; }Public ReadWrite Property KeyTipPlacementMode As KeyTipPlacementMode// This API is not available in Javascript.
<textElement KeyTipPlacementMode="keyTipPlacementModeMemberName"/>
A value of the enumeration. The default is Auto.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty KeyTipPlacementModeProperty
Identifies the KeyTipPlacementMode dependency property.
public : static DependencyProperty KeyTipPlacementModeProperty { get; }public static DependencyProperty KeyTipPlacementModeProperty { get; }Public Static ReadOnly Property KeyTipPlacementModeProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the KeyTipPlacementMode dependency property.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset KeyTipVerticalOffset
Gets or sets a value that indicates how far up or down the keytip is placed in relation to the text element.
public : double KeyTipVerticalOffset { get; set; }public double KeyTipVerticalOffset { get; set; }Public ReadWrite Property KeyTipVerticalOffset As double// This API is not available in Javascript.
<textElement KeyTipVerticalOffset="double"/>
- Value
- double double double double
The number of pixels to move the KeyTip. Positive values move it down. Negative values move it up.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty KeyTipVerticalOffsetProperty
Identifies the KeyTipVerticalOffset dependency property.
public : static DependencyProperty KeyTipVerticalOffsetProperty { get; }public static DependencyProperty KeyTipVerticalOffsetProperty { get; }Public Static ReadOnly Property KeyTipVerticalOffsetProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the KeyTipVerticalOffset dependency property.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Language Language Language Language
Gets or sets localization/globalization language information that applies to a TextElement.
public : PlatForm::String Language { get; set; }public string Language { get; set; }Public ReadWrite Property Language As string// This API is not available in Javascript.
<textElement Language="languageString" .../.
- Value
- PlatForm::String string string string
A string specifying language and culture that follows the RFC 3066 / ISO 639-1 standards. For example, U.S. English is "en-US".
LanguageProperty LanguageProperty LanguageProperty LanguageProperty
Identifies the Language dependency property.
public : static DependencyProperty LanguageProperty { get; }public static DependencyProperty LanguageProperty { get; }Public Static ReadOnly Property LanguageProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the Language dependency property.
Name Name Name Name
Gets or sets a unique identification for the object. Name can only be set from initial parsing of XAML.
public : PlatForm::String Name { get; }public string Name { get; }Public ReadOnly Property Name As string// This API is not available in Javascript.
<textElement Name="xamlNameString"/>
- Value
- PlatForm::String string string string
The unique identifier for the object. This property is read-only for code, but write-only for XAML, due to special parser handling of XAML properties named "Name".
TextDecorations TextDecorations TextDecorations TextDecorations
Gets or sets a value that indicates what decorations are applied to the text.
public : TextDecorations TextDecorations { get; set; }public TextDecorations TextDecorations { get; set; }Public ReadWrite Property TextDecorations As TextDecorations// This API is not available in Javascript.
A value of the enumeration. The default is None.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
TextDecorationsProperty TextDecorationsProperty TextDecorationsProperty TextDecorationsProperty
Identifies the TextDecorations dependency property.
public : static DependencyProperty TextDecorationsProperty { get; }public static DependencyProperty TextDecorationsProperty { get; }Public Static ReadOnly Property TextDecorationsProperty As DependencyProperty// This API is not available in Javascript.
The identifier for the TextDecorations dependency property.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Methods
FindName(String) FindName(String) FindName(String) FindName(String)
Retrieves an object in the object model / runtime object graph by referencing the object's x:Name or Name attribute value.
public : PlatForm::Object FindName(PlatForm::String name)public object FindName(String name)Public Function FindName(name As String) As object// This API is not available in Javascript.
- name
- PlatForm::String String String String
The name of the object to retrieve.
The object that has the specified name, or null if no object is retrieved.
Remarks
FrameworkElement is the class that implements Name support for most other run-time classes, but TextElement is not a FrameworkElement derived class. TextElement supports its own Name and FindName implementations, and the underlying logic for name lookup does not differentiate between TextElement and FrameworkElement. You can use the TextElement -implemented FindName to find a named FrameworkElement, and vice versa.
Because FindName relies on all the XAML sources being parsed for the Name attributes, you should not attempt to call FindName until the XAML is loaded.
Names and FindName are influenced by the concept of a XAML namescope.
OnDisconnectVisualChildren() OnDisconnectVisualChildren() OnDisconnectVisualChildren() OnDisconnectVisualChildren()
Override this method to implement how layout and logic should behave when items are removed from a class-specific content or child property.
protected : virtual void OnDisconnectVisualChildren()protected virtual void OnDisconnectVisualChildren()Protected Overridable Function OnDisconnectVisualChildren() As void// This API is not available in Javascript.
Remarks
TextElement does not define any of the content or children properties that OnDisconnectVisualChildren might act upon. Such properties are introduced by derived classes such as Paragraph.
Events
AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed AccessKeyDisplayDismissed
Occurs when the access key sequence is complete to notify controls that they should hide access key visuals.
public : event TypedEventHandler AccessKeyDisplayDismissed<TextElement, AccessKeyDisplayDismissedEventArgs>public event TypedEventHandler AccessKeyDisplayDismissed<TextElement, AccessKeyDisplayDismissedEventArgs>Public Event AccessKeyDisplayDismissed<TextElement, AccessKeyDisplayDismissedEventArgs>// This API is not available in Javascript.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested AccessKeyDisplayRequested
Occurs when the access key sequence is started to notify controls that they should show access key visuals.
public : event TypedEventHandler AccessKeyDisplayRequested<TextElement, AccessKeyDisplayRequestedEventArgs>public event TypedEventHandler AccessKeyDisplayRequested<TextElement, AccessKeyDisplayRequestedEventArgs>Public Event AccessKeyDisplayRequested<TextElement, AccessKeyDisplayRequestedEventArgs>// This API is not available in Javascript.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
This event is not raised if the element is under an element with its Visibility property set to Collapsed.
AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked AccessKeyInvoked
Occurs when a user completes an access key sequence to notify the element that the access key action should be invoked.
public : event TypedEventHandler AccessKeyInvoked<TextElement, AccessKeyInvokedEventArgs>public event TypedEventHandler AccessKeyInvoked<TextElement, AccessKeyInvokedEventArgs>Public Event AccessKeyInvoked<TextElement, AccessKeyInvokedEventArgs>// This API is not available in Javascript.
| Device family |
Windows 10 Creators Update (introduced v10.0.15063.0)
|
| API contract |
Windows.Foundation.UniversalApiContract (introduced v4)
|
Remarks
For more info, see UIElement.AccessKeyInvoked.