Skip to main content

GetTopLevel Method

Gets the TopLevel for which the given Visual is hosted in.

Definition​

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

public static TopLevel? GetTopLevel(
Visual? visual
)

Parameters​

  Visual
The visual to query its TopLevel

Return Value​

TopLevel
The TopLevel

See Also​

Reference​

TopLevel Class
Avalonia.Controls Namespace