Finds a parent by predicate. It first tries to find the parent via theUserControl.Parent property, and if that doesn’t satisfy, it uses theUserControl.TemplatedParent property.
Parameters
Name
Description
view
The control.
predicate
The predicate.
Returns
ornull if no parent is found that matches the predicate.
FindParentByPredicate(FrameworkElement view, Predicate<object> predicate, int maxDepth)
Finds a parent by predicate. It first tries to find the parent via theUserControl.Parent property, and if that doesn’t satisfy, it uses theUserControl.TemplatedParent property.
Parameters
Name
Description
view
The control.
predicate
The predicate.
maxDepth
The maximum number of levels to go up when searching for the parent. If smaller than 0, no maximum is used.
Returns
ornull if no parent is found that matches the predicate.
FindParentViewModelContainer(IView view)
Finds the parent view model container.
Parameters
Name
Description
view
The view.
Returns
The IViewModelContainer ornull if the container is not found.
GetParent(IView view)
Gets the parent of the specified view.
Parameters
Name
Description
view
The view.
Returns
GetParent(FrameworkElement element)
Gets the parent of the specified element.
Parameters
Name
Description
element
The element.
Returns
The parent ornull if there is no parent.
GetPossibleParents(FrameworkElement element)
Gets the possible parents of the specified element.
Parameters
Name
Description
element
The element.
Returns
The possible parents ornull if there is no parent.