Esempio n. 1
0
        public static T FindGridElement <T>(DependencyObject obj, bool failIfNothingFound = true) where T : DependencyObject
        {
            ObjectChecker <T> checker = new ObjectChecker <T>();

            DObjectChecker.CheckSubTree(obj, checker, failIfNothingFound);
            return((T)checker.Element);
        }
Esempio n. 2
0
        public static T FindGridElement <T>(DependencyObject obj, DependencyProperty property, object value,
                                            bool exactType = false, bool onlyVisibleChildren = false, bool failIfNothingFound = true)
            where T : DependencyObject
        {
            ObjectChecker <T> checker
                = new ObjectChecker <T>(new DPropertyInfo(property, value), exactType, onlyVisibleChildren);

            DObjectChecker.CheckSubTree(obj, checker, failIfNothingFound);
            return((T)checker.Element);
        }