コード例 #1
0
        private void Save(Person value)
        {
            //Person.LastUpdated = DateTime.Now;
            _eventAggregator.GetEvent<PersonUpdatedEvent>().Publish(String.Format("{0}, {1}",Person.LastName, Person.FirstName));

            int count = _repository.SavePerson(Person);
            MessageBox.Show(count.ToString()); //DEMO only, NO message boxes in view model!!!
        }
コード例 #2
0
 public void CreatePerson(string firstName, string lastName)
 {
     Person = new Person()
     {
         FirstName = firstName,
         LastName = lastName,
         Age = 0
     };
 }
コード例 #3
0
 private void CreatePerson()
 {
     Person = new Person
     {
         FirstName = "Bob",
         LastName = "Smith",
         Age = 46
     };
 }
コード例 #4
0
        public IList<Person> GetPeople()
        {
            List<Person> people = new List<Person>();

            for (int i = 0; i < 50; i++)
            {
                var person = new Person();
                person.FirstName = String.Format("First{0}", i);
                person.LastName = String.Format("Last{0}", i);
                person.Age = i;
                person.Email = String.Format("{0}.{1}@domain.com", person.FirstName, person.LastName);
                person.ImagePath = GetPersonImagePath(i);
                people.Add(person);
                Thread.Sleep(80); //simulate longer process
            }

            return people;
        }
コード例 #5
0
 private bool CanSave(Person value)
 {
     return Person != null && Person.Error == null;
 }
コード例 #6
0
 public int SavePerson(Person person)
 {
     count++;
     person.LastUpdated = DateTime.Now;
     return count;
 }