GetWindow Method

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 Shared Function GetWindow (
	dependencyObject As DependencyObject
) As Window

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:
© 2016 Microsoft