C# Class Catel.MVVM.Views.ViewExtensions

Show file Open project: Catel/Catel

Public Methods

Method Description
EnsureVisualTree ( this view ) : void

Ensures that a visual tree exists for the view.

FindLogicalOrVisualAncestor ( this startElement, Predicate condition, int maxDepth = -1 ) : object

Finds the logical or visual ancestor according to the predicate.

FindParentByPredicate ( this view, Predicate predicate ) : UIView

Finds a parent by predicate. It first tries to find the parent via the UserControl.Parent property, and if that doesn't satisfy, it uses the UserControl.TemplatedParent property.

FindParentByPredicate ( this view, Predicate predicate, int maxDepth ) : UIView

Finds a parent by predicate. It first tries to find the parent via the UserControl.Parent property, and if that doesn't satisfy, it uses the UserControl.TemplatedParent property.

FindParentViewModelContainer ( this view ) : IViewModelContainer

Finds the parent view model container.

FindVisualAncestor ( this startElement, Predicate condition, int maxDepth = -1 ) : object

Finds the visual ancestor according to the predicate.

GetVisualParent ( this element ) : UIView

Gets the logical parent of the specified dependency object.

Private Methods

Method Description
FinalDispatch ( IView view, Action action ) : void

Method Details

EnsureVisualTree() public static method

Ensures that a visual tree exists for the view.
public static EnsureVisualTree ( this view ) : void
view this The view.
return void

FindLogicalOrVisualAncestor() public static method

Finds the logical or visual ancestor according to the predicate.
public static FindLogicalOrVisualAncestor ( this startElement, Predicate condition, int maxDepth = -1 ) : object
startElement this The start element.
condition Predicate The condition.
maxDepth int The maximum number of levels to go up when searching for the parent. If smaller than 0, no maximum is used.
return object

FindParentByPredicate() public static method

Finds a parent by predicate. It first tries to find the parent via the UserControl.Parent property, and if that doesn't satisfy, it uses the UserControl.TemplatedParent property.
public static FindParentByPredicate ( this view, Predicate predicate ) : UIView
view this The control.
predicate Predicate The predicate.
return UIView

FindParentByPredicate() public static method

Finds a parent by predicate. It first tries to find the parent via the UserControl.Parent property, and if that doesn't satisfy, it uses the UserControl.TemplatedParent property.
public static FindParentByPredicate ( this view, Predicate predicate, int maxDepth ) : UIView
view this The control.
predicate Predicate The predicate.
maxDepth int The maximum number of levels to go up when searching for the parent. If smaller than 0, no maximum is used.
return UIView

FindParentViewModelContainer() public static method

Finds the parent view model container.
public static FindParentViewModelContainer ( this view ) : IViewModelContainer
view this The view.
return IViewModelContainer

FindVisualAncestor() public static method

Finds the visual ancestor according to the predicate.
public static FindVisualAncestor ( this startElement, Predicate condition, int maxDepth = -1 ) : object
startElement this The start element.
condition Predicate The condition.
maxDepth int The maximum number of levels to go up when searching for the parent. If smaller than 0, no maximum is used.
return object

GetVisualParent() public static method

Gets the logical parent of the specified dependency object.
The is null.
public static GetVisualParent ( this element ) : UIView
element this The element to retrieve the parent from.
return UIView