RichTextBlockAutomationPeer
RichTextBlockAutomationPeer
RichTextBlockAutomationPeer
RichTextBlockAutomationPeer
Class
Definition
Exposes RichTextBlock types to Microsoft UI Automation.
public : class RichTextBlockAutomationPeer : FrameworkElementAutomationPeer, IRichTextBlockAutomationPeerpublic class RichTextBlockAutomationPeer : FrameworkElementAutomationPeer, IRichTextBlockAutomationPeerPublic Class RichTextBlockAutomationPeer Inherits FrameworkElementAutomationPeer Implements IRichTextBlockAutomationPeer// This API is not available in Javascript.
- Inheritance
-
FrameworkElementAutomationPeerFrameworkElementAutomationPeerFrameworkElementAutomationPeerFrameworkElementAutomationPeerRichTextBlockAutomationPeerRichTextBlockAutomationPeerRichTextBlockAutomationPeerRichTextBlockAutomationPeer
- 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 Windows Runtime RichTextBlock class creates a new RichTextBlockAutomationPeer as its OnCreateAutomationPeer definition. RichTextBlock is sealed, so the normal scenario of deriving from the RichTextBlock class and its existing peer isn't applicable to RichTextBlockAutomationPeer.
Default peer implementation and overrides in RichTextBlockAutomationPeer
RichTextBlockAutomationPeer has overrides of Core methods such that the associated AutomationPeer methods provide peer-specific information to a Microsoft UI Automation client.
- GetPattern reports pattern support for TextPattern, but see "TextPattern support" in this topic for more info.
- GetClassName returns "RichTextBlock".
- GetAutomationControlType returns AutomationControlType.Text.
- GetName returns a plain-text representation of the RichTextBlock text content from Blocks.
- IsControlElement returns a value based on the template parent. If there is a template parent then it returns true, otherwise the value is false. The scenario here is that a templated control may have forwarded to this peer for text support, but normally a RichTextBlock by itself isn't a full-fledged control. The peer also has other behaviors that are provided by the base FrameworkElementAutomationPeer class. For more info, see "Base implementation in FrameworkElementAutomationPeer" section of Custom automation peers.
TextPattern support
RichTextBlockAutomationPeer supports the TextPattern Microsoft UI Automation pattern. The support for this pattern is implemented as native code by the peer, so you won't see public API for the RichTextBlockAutomationPeer peer class that exposes the pattern implementation for extension. And you won't see ITextRangeProvider and the similar managed interfaces in the RichTextBlockAutomationPeer inheritance. But Microsoft UI Automation clients can use the TextPattern pattern implemented by this peer and call its native API surface.
Here are some specifics of the TextPattern implementation in RichTextBlockAutomationPeer:
- Move, MoveEndpointByUnit and ExpandToEnclosingUnit are supported for all TextUnit units including the Format value.
- GetAttributeValue returns results within ranges for these text attributes: UIA_FontNameAttributeId, UIA_FontSizeAttributeId, UIA_FontWeightAttributeId, UIA_ForegroundColorAttributeId, UIA_CultureAttributeId, UIA_IsHiddenAttributeId, UIA_IsItalicAttributeId, UIA_IsReadOnlyAttributeId, UIA_CapStyleAttributeId, UIA_HorizontalTextAlignmentAttributeId, UIA_IndentationFirstLineAttributeId, UIA_IndentationLeadingAttributeId, UIA_IsSuperscriptAttributeId, UIA_IsSubscriptAttributeId, UIA_MarginBottomAttributeId, UIA_MarginLeadingAttributeId, UIA_MarginTopAttributeId, UIA_MarginTrailingAttributeId.
- For the Move, MoveEndpointByUnit and ExpandToEnclosingUnit API when using the Format value, a format change is defined as a change within a range in any of the supported text attributes listed above.
- ScrollIntoView is exposed in the pattern, but can only result in a behavior if the owner control is contained within a ScrollViewer. Otherwise a RichTextBlock doesn't have its own scrolling behavior. If the RichTextBlock does have a ScrollViewer parent, then the ScrollIntoView call fires a system event that requests the parent ScrollViewer to scroll. The alignToTop value is ignored.
Constructors
RichTextBlockAutomationPeer(RichTextBlock) RichTextBlockAutomationPeer(RichTextBlock) RichTextBlockAutomationPeer(RichTextBlock) RichTextBlockAutomationPeer(RichTextBlock)
Initializes a new instance of the RichTextBlockAutomationPeer class.
public : RichTextBlockAutomationPeer(RichTextBlock owner)public RichTextBlockAutomationPeer(RichTextBlock owner)Public Sub New(owner As RichTextBlock)// This API is not available in Javascript.
The RichTextBlock to create a peer for.