[]
Returns a DependencyObject value that represents the parent of the visual object of the specified type. Method looks up the visual tree until the desired parent element is found or parent element is null.
public static DependencyObject GetParentOfType(DependencyObject reference, Type type)
Public Shared Function GetParentOfType(reference As DependencyObject, type As Type) As DependencyObject
| Type | Name | Description |
|---|---|---|
| DependencyObject | reference | The visual whose parent is returned. |
| Type | type | The Type of the parent element to search for. |
| Type | Description |
|---|---|
| DependencyObject | The parent of the visual. |
Returns a DependencyObject value that represents the parent of the visual object of the specified type. Method looks up the visual tree until the desired parent element is found or parent element is equal to the specified endObject.
public static DependencyObject GetParentOfType(DependencyObject reference, Type type, DependencyObject endObject)
Public Shared Function GetParentOfType(reference As DependencyObject, type As Type, endObject As DependencyObject) As DependencyObject
| Type | Name | Description |
|---|---|---|
| DependencyObject | reference | The visual whose parent is returned. |
| Type | type | The Type of the parent element to search for. |
| DependencyObject | endObject | The visual representing the end point of search. |
| Type | Description |
|---|---|
| DependencyObject | The parent of the visual. |
Returns a DependencyObject value that represents the parent of the visual object of the specified type. Method looks up the visual tree until the desired parent element is found or parent element is null.
public static DependencyObject GetParentOfType(DependencyObject reference, Type type, bool lookOutsideVisualTree)
Public Shared Function GetParentOfType(reference As DependencyObject, type As Type, lookOutsideVisualTree As Boolean) As DependencyObject
| Type | Name | Description |
|---|---|---|
| DependencyObject | reference | The visual whose parent is returned. |
| Type | type | The Type of the parent element to search for. |
| bool | lookOutsideVisualTree | Specifies whether the search should go on outside the VisualTree. |
| Type | Description |
|---|---|
| DependencyObject | The parent of the visual. |
Returns a DependencyObject value that represents the parent of the visual object of the specified type. Method looks up the visual tree until the desired parent element is found or parent element is equal to the specified endObject.
public static DependencyObject GetParentOfType(DependencyObject reference, Type type, DependencyObject endObject, bool lookOutsideVisualTree)
Public Shared Function GetParentOfType(reference As DependencyObject, type As Type, endObject As DependencyObject, lookOutsideVisualTree As Boolean) As DependencyObject
| Type | Name | Description |
|---|---|---|
| DependencyObject | reference | The visual whose parent is returned. |
| Type | type | The Type of the parent element to search for. |
| DependencyObject | endObject | The visual representing the end point of search. |
| bool | lookOutsideVisualTree | Specifies whether the search should go on outside the VisualTree. |
| Type | Description |
|---|---|
| DependencyObject | The parent of the visual. |