Window::GetWindow Method (DependencyObject^)

 

Returns a reference to the Window object that hosts the content tree within which the dependency object is located.

Namespace:   System.Windows
Assembly:  PresentationFramework (in PresentationFramework.dll)

public:
static Window^ GetWindow(
	DependencyObject^ dependencyObject
)

Parameters

dependencyObject
Type: System.Windows::DependencyObject^

The dependency object.

Return Value

Type: System.Windows::Window^

A Window reference to the host window.

Exception Condition
ArgumentNullException

dependencyObject is null.

.NET Framework
Available since 3.0
Silverlight
Available since 5.0
Return to top
Show: