Example #1
0
        private CustGroupViewModel(CustGroup custgroup, CustGroupViewModel parent)
        {
            _custgroup = custgroup;
            _parent = parent;

            _children = new ObservableCollection<CustGroupViewModel>(
                    (from child in _custgroup.Children
                     select new CustGroupViewModel(child, this))
                     .ToList<CustGroupViewModel>());
        }
Example #2
0
        private CustGroupViewModel(CustGroup custgroup, CustGroupViewModel parent)
        {
            _custgroup = custgroup;
            _parent    = parent;

            _children = new ObservableCollection <CustGroupViewModel>(
                (from child in _custgroup.Children
                 select new CustGroupViewModel(child, this))
                .ToList <CustGroupViewModel>());
        }
Example #3
0
        public CustGroupTreeViewModel(CustGroup root)
        {
            _root = new CustGroupViewModel(root);

            _firstGeneration = new ObservableCollection<CustGroupViewModel>(
                new CustGroupViewModel[] 
                { 
                    _root
                });

            _firstGeneration.CollectionChanged += _firstGeneration_CollectionChanged;

            _searchCommand = new SearchFamilyTreeCommand(this);
        }
Example #4
0
        public CustGroupTreeViewModel(CustGroup root)
        {
            _root = new CustGroupViewModel(root);

            _firstGeneration = new ObservableCollection <CustGroupViewModel>(
                new CustGroupViewModel[]
            {
                _root
            });

            _firstGeneration.CollectionChanged += _firstGeneration_CollectionChanged;

            _searchCommand = new SearchFamilyTreeCommand(this);
        }
Example #5
0
        IEnumerable <CustGroupViewModel> FindMatches(string searchText, CustGroupViewModel person)
        {
            if (person.NameContainsText(searchText))
            {
                yield return(person);
            }

            foreach (CustGroupViewModel child in person.Children)
            {
                foreach (CustGroupViewModel match in this.FindMatches(searchText, child))
                {
                    yield return(match);
                }
            }
        }
Example #6
0
        IEnumerable<CustGroupViewModel> FindMatches(string searchText, CustGroupViewModel person)
        {
            if (person.NameContainsText(searchText))
                yield return person;

            foreach (CustGroupViewModel child in person.Children)
                foreach (CustGroupViewModel match in this.FindMatches(searchText, child))
                    yield return match;
        }