Skip to main content

CreatePeerForElement Method

Gets the AutomationPeer for a Control, creating it if necessary.

Definition

Namespace: Avalonia.Automation.Peers
Assembly: Avalonia.Controls (in Avalonia.Controls.dll)

public static AutomationPeer CreatePeerForElement(
Control element
)

Parameters

  Control
The control.

Return Value

AutomationPeer
The automation peer.

Remarks

Despite the name (which comes from the analogous WPF API), this method does not create a new peer if one already exists: instead it returns the existing peer.

See Also

Reference

ControlAutomationPeer Class
Avalonia.Automation.Peers Namespace