BaseWPFHelpers.Helpers.SingleFindDownInTree C# (CSharp) Method

SingleFindDownInTree() public static method

Typically used method that walks down the visual tree from a given point to locate a given match only once. Typically used with Name/ItemHost etc type matching. Only returns one element
public static SingleFindDownInTree ( 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 SingleFindDownInTree(Visual parent, IFinderMatchVisualHelper helper)
        {
            helper.StopAfterFirst = true;

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

            FrameworkElement feRet = null;

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

            return feRet;
        }