コード例 #1
0
        private PersonViewModel(Person person, PersonViewModel parent)
        {
            _person = person;
            _parent = parent;

            _children = new ReadOnlyCollection<PersonViewModel>(
                    (from child in _person.Children
                     select new PersonViewModel(child, this))
                     .ToList<PersonViewModel>());
        }
コード例 #2
0
        public FamilyTreeViewModel(Person rootPerson)
        {
            _rootPerson = new PersonViewModel(rootPerson);

            _firstGeneration = new ReadOnlyCollection<PersonViewModel>(
                new PersonViewModel[]
                {
                    _rootPerson
                });

            _searchCommand = new SearchFamilyTreeCommand(this);
        }
コード例 #3
0
 public PersonViewModel(Person person)
     : this(person, null)
 {
 }