Method ExtWpf.FindVisualAncestor(+ 1 overload)
Overload
Calls callback function f for each visual ancestor (System.Windows.Media.VisualTreeHelper.GetParent), and returns the ancestor for which f returns true
.
Also can return last or null
.
public static DependencyObject FindVisualAncestor(this DependencyObject t, bool andThis, Func<DependencyObject, bool> f, object last, bool andLast)
Parameters
t (DependencyObject) |
andThis (bool)
Include this object. |
f (Func<DependencyObject, bool>) |
last (object)
When found this ancestor, stop and return last if andLast |
andLast (bool)
If last found, return last instead of |
Returns
Overload(top)
Returns the nearest visual ancestor (System.Windows.Media.VisualTreeHelper.GetParent) of type T.
Also can return last or null
.
public static DependencyObject FindVisualAncestor<T>(this DependencyObject t, bool andThis, object last, bool andLast) where T : DependencyObject
Parameters
t (DependencyObject) |
andThis (bool)
Include this object. |
last (object)
When found this ancestor, stop and return last if andLast |
andLast (bool)
If last found, return last instead of |
Returns
Type Parameters
T |