Click or drag to resize
weroSoft AG, Software
WindowsHelperGetParentDependencyObjectOfType Method
The documentation is integral part of the weroSoft product documentation. This part is intended to be used by developers only.
Extension method for dependency objects to resolve a parent of a defined type.

Namespace:  WeroSoft
Assembly:  WeroSoft.Windows.Library (in WeroSoft.Windows.Library.dll) Version: 3.0 Pre-Release
Syntax
C#
public static DependencyObject GetParentDependencyObjectOfType(
	this DependencyObject current,
	Type type
)

Parameters

current
Type: System.WindowsDependencyObject
Object from whose position the defined type shall be searched.
type
Type: SystemType
Type of the dependency object within the hierarchy which shall be resolved.

Return Value

Type: DependencyObject
The first found object of the defined type. If the type could not be found the method returns null.

Usage Note

In Visual Basic and C#, you can call this method as an instance method on any object of type DependencyObject. When you use instance method syntax to call this method, omit the first parameter. For more information, see Extension Methods (Visual Basic) or Extension Methods (C# Programming Guide).
Remarks
This method uses the logical tree and search recursively up to the root.
See Also