ExtensionMethods.FindCommonAncestor Method (DependencyObject, DependencyObject)
Finds the common ancestor of obj1 and obj2 using the GetVisualOrLogicalParent as the parent evaluation method.
Namespace: Microsoft.VisualStudio.PlatformUI
Assembly: Microsoft.VisualStudio.Shell.10.0 (in Microsoft.VisualStudio.Shell.10.0.dll)
Syntax
'宣言
<ExtensionAttribute> _
Public Shared Function FindCommonAncestor ( _
obj1 As DependencyObject, _
obj2 As DependencyObject _
) As DependencyObject
'使用
Dim obj1 As DependencyObject
Dim obj2 As DependencyObject
Dim returnValue As DependencyObject
returnValue = obj1.FindCommonAncestor(obj2)
public static DependencyObject FindCommonAncestor(
this DependencyObject obj1,
DependencyObject obj2
)
[ExtensionAttribute]
public:
static DependencyObject^ FindCommonAncestor(
DependencyObject^ obj1,
DependencyObject^ obj2
)
static member FindCommonAncestor :
obj1:DependencyObject *
obj2:DependencyObject -> DependencyObject
public static function FindCommonAncestor(
obj1 : DependencyObject,
obj2 : DependencyObject
) : DependencyObject
Parameters
- obj1
Type: System.Windows.DependencyObject
The first object.
- obj2
Type: System.Windows.DependencyObject
The second object.
Return Value
Type: System.Windows.DependencyObject
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).
.NET Framework Security
- Full trust for the immediate caller. This member cannot be used by partially trusted code. For more information, see Using Libraries from Partially Trusted Code.