public static FrameworkElement FindElementInVisualTree(Visual root, string id) { FrameworkElement frameworkElement = root as FrameworkElement; if (frameworkElement != null && frameworkElement.Name == id) { return(frameworkElement); } for (int childIndex = 0; childIndex < VisualTreeHelper.GetChildrenCount((DependencyObject)root); ++childIndex) { Visual root1 = VisualTreeHelper.GetChild((DependencyObject)root, childIndex) as Visual; if (root1 != null) { FrameworkElement elementInVisualTree = ElementUtilities.FindElementInVisualTree(root1, id); if (elementInVisualTree != null) { return(elementInVisualTree); } } } return((FrameworkElement)null); }
public static bool HasVisualTreeAncestorOfType(DependencyObject element, Type type) { return(ElementUtilities.GetVisualTreeAncestorOfType(element, type) != null); }
public static Rect GetActualBoundsInParent(FrameworkElement element) { return(ElementUtilities.GetActualBoundsCore(element, true)); }
public static Vector GetCorrespondingVector(Vector vector, Matrix matrix) { return(ElementUtilities.GetCorrespondingVector(vector, matrix, (AxisConstraint)null)); }
public static Rect GetActualBounds(FrameworkElement element) { return(ElementUtilities.GetActualBoundsCore(element, false)); }