Esempio n. 1
0
        public static List <ElementInfo> Find(this ListView listView, Predicate <Element> predicate, Predicate <Element> containerPredicate)
        {
            var result = new List <ElementInfo>();

            result.AddRange(Find(listView.Header, predicate, containerPredicate));
            result.AddRange(Find(listView.Footer, predicate, containerPredicate));

            if (listView.ItemsSource == null)
            {
                return(result);
            }

            var groups = ListViewCrawler.GetCellGroups(listView);

            foreach (var group in groups)
            {
                result.AddRange(Find(group, listView, predicate, containerPredicate));
            }

            return(result);
        }
Esempio n. 2
0
        public static string Render(this ListView listView)
        {
            var result = "";

            if (listView.ItemsSource == null)
            {
                return(result);
            }

            result += Render(listView.Header);

            var groups = ListViewCrawler.GetCellGroups(listView);

            foreach (var group in groups)
            {
                result += Render(group);
            }

            result.TrimEnd('\n');
            result += Render(listView.Footer);

            return(result);
        }