Skip to main content

GetParentGrid Method

Retrieves the Grid that ultimately hosts this GridSplitter in the visual/logical tree.

Definition

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

protected virtual Grid? GetParentGrid()

Return Value

Grid
The containing Grid if one is found; otherwise null.

Remarks

A splitter can be placed directly inside a Grid or indirectly inside an ItemsControl that uses a Grid as its ItemsPanel. In the latter case the first logical parent is usually an ContentPresenter (or the items control itself), so the method walks these intermediate containers to locate the underlying grid.

See Also

Reference

GridSplitter Class
Avalonia.Controls Namespace