Esempio n. 1
0
        public static T GetFirstParentOf <T> (this DependencyObject start, eTraversalTree tree = eTraversalTree.Visual) where T : DependencyObject
        {
            var parentSelector = ParentSelectorForTree(tree);
            var childSelector  = ChildSelectorForTree(tree);

            return(TreeTraversal <DependencyObject> .GetFirstParentOfType <T>(start, getParentMethodOverride : _ => parentSelector(_), getChildrenMethodOverride : _ => childSelector(_)));
        }