Share via


GetParent Method

Gets the parent object of the calling object.

XAML
Cannot use methods in XAML.
Scripting
retval = object.GetParent()

Return Value

object

A reference to the specified parent object if successful; otherwise, returns null.

Remarks

The only objects that can contain UIElement children are Canvas or InkPresenter. Path can have child elements, but these are geometries rather than UIElements.

Applies To

Canvas, Ellipse, Glyphs, Image, InkPresenter, Line, MediaElement, Path, Polygon, Polyline, Rectangle, TextBlock

See Also

Referencing and Modifying Silverlight Objects
FindName
GetHost