BaseWPFHelpers.Helpers.SingleFindInTree C# (CSharp) Method

SingleFindInTree() public static method

All way visual tree helper that searches UP and DOWN in a tree for the matching pattern. This is used to walk for name matches or type matches typically. Returns only the first matching element
public static SingleFindInTree ( Visual parent, IFinderMatchVisualHelper helper ) : FrameworkElement
parent Visual Start point in the tree to search
helper IFinderMatchVisualHelper Match Helper to use
return System.Windows.FrameworkElement
        public static FrameworkElement SingleFindInTree(Visual parent, IFinderMatchVisualHelper helper)
        {
            helper.StopAfterFirst = true;

            List<FrameworkElement> lst = FindInTree(parent, helper);

            FrameworkElement feRet = null;

            if (lst.Count > 0) feRet = lst[0];

            return feRet;
        }