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!!! }
public void CreatePerson(string firstName, string lastName) { Person = new Person() { FirstName = firstName, LastName = lastName, Age = 0 }; }
private void CreatePerson() { Person = new Person { FirstName = "Bob", LastName = "Smith", Age = 46 }; }
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; }
private bool CanSave(Person value) { return Person != null && Person.Error == null; }
public int SavePerson(Person person) { count++; person.LastUpdated = DateTime.Now; return count; }