Exemplo n.º 1
0
 public void Initialize()
 {
     _model = new ContactList();
     _model.AddContact(new Contact() { FirstName = "Charles", LastName = "Babbage" });
     _model.AddContact(new Contact() { FirstName = "Alan", LastName = "Turing" });
     _contactViewModels = new DependentList<ContactViewModel>(() =>
         from c in _model.Contacts
         select new ContactViewModel(c)
     );
 }
        public void Initialize()
        {
            _contactList = new ContactList();
            _viewModel = new ContactListViewModel(_contactList);
            _contactList.AddContact(new Contact() { FirstName = "Michael", LastName = "Perry" });
            _contactList.AddContact(new Contact() { FirstName = "Ada", LastName = "Lovelace" });
            _contactList.AddContact(new Contact() { FirstName = "Charles", LastName = "Babbage" });

            _collectionChangedCount = 0;
            _viewModel.ContactsCollectionChanged +=
                delegate
                {
                    _collectionChangedCount++;
                };
        }