Table of Contents

Class AccessText

Namespace
Avalonia.Controls.Primitives
Assembly
Avalonia.Controls.dll

A text block that displays a character prefixed with an underscore as an access key.

public class AccessText : TextBlock, INotifyPropertyChanged, IDataContextProvider, IThemeVariantHost, IResourceHost, IResourceNode, IStyleHost, ISetLogicalParent, ISetInheritanceParent, ISupportInitialize, IStyleable, INamed, IInputElement, IDataTemplateHost, ISetterValue, ILogical
Inheritance
AccessText
Implements
Inherited Members
Extension Methods

Constructors

AccessText()

Initializes a new instance of the AccessText class.

public AccessText()

Fields

ShowAccessKeyProperty

Defines the ShowAccessKey attached property.

public static readonly AttachedProperty<bool> ShowAccessKeyProperty

Field Value

AttachedProperty<bool>

Properties

AccessKey

Gets the access key.

public char AccessKey { get; }

Property Value

char

ShowAccessKey

Gets or sets a value indicating whether the access key should be underlined.

public bool ShowAccessKey { get; set; }

Property Value

bool

Methods

CreateTextLayout(string?)

Creates the TextLayout used to render the text.

protected override TextLayout CreateTextLayout(string? text)

Parameters

text string

Returns

TextLayout

A TextLayout object.

OnAttachedToVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is added to a rooted visual tree.

protected override void OnAttachedToVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.

OnCreateAutomationPeer()

Returns a new, type-specific AutomationPeer implementation for the control.

protected override AutomationPeer OnCreateAutomationPeer()

Returns

AutomationPeer

The type-specific AutomationPeer implementation.

OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs)

Called when the control is removed from a rooted visual tree.

protected override void OnDetachedFromVisualTree(VisualTreeAttachmentEventArgs e)

Parameters

e VisualTreeAttachmentEventArgs

The event args.