示例#1
0
        private ZenfolioTreeViewModel(GroupElement groupElement, ZenfolioTreeViewModel parent)
        {
            GroupElement = groupElement;
            Parent       = parent;

            if (groupElement is Group)
            {
                Children = (GroupElement as Group).Elements != null ? new ObservableCollection <ZenfolioTreeViewModel>(
                    (from child in (GroupElement as Group).Elements
                     select new ZenfolioTreeViewModel(child, this))
                    .ToList <ZenfolioTreeViewModel>())
                         : null;
            }
        }
示例#2
0
        IEnumerable <ZenfolioTreeViewModel> FindMatches(string searchText, ZenfolioTreeViewModel person)
        {
            if (person.NameContainsText(searchText))
            {
                yield return(person);
            }

            foreach (ZenfolioTreeViewModel child in person.Children)
            {
                foreach (ZenfolioTreeViewModel match in this.FindMatches(searchText, child))
                {
                    yield return(match);
                }
            }
        }
示例#3
0
 private void RefreshRootGroup(ZenfolioTreeViewModel rootGroup)
 {
     FirstGeneration = new ObservableCollection <ZenfolioTreeViewModel>(new ZenfolioTreeViewModel[] { rootGroup });
 }