.NET Framework Class Library
Window.GetWindow Method
Returns a reference to the Window object that hosts the content tree within which the dependency object is located.
Assembly: PresentationFramework (in PresentationFramework.dll)
Syntax
Visual Basic
Public Shared Function GetWindow ( _ dependencyObject As DependencyObject _ ) As Window
C#
public static Window GetWindow( DependencyObject dependencyObject )
Visual C++
public: static Window^ GetWindow( DependencyObject^ dependencyObject )
F#
static member GetWindow : dependencyObject:DependencyObject -> Window
Parameters
- dependencyObject
- Type: System.Windows.DependencyObject
The dependency object.
Exceptions
| Exception | Condition |
|---|---|
| ArgumentNullException |
dependencyObject is null. |
Version Information
.NET Framework
Supported in: 4, 3.5, 3.0.NET Framework Client Profile
Supported in: 4, 3.5 SP1Platforms
Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2
The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
See Also