private void PersonChanged(Person person) { PersonListItemViewModel existingPersonViewModel = People.SingleOrDefault(x => x.Model == person); if (existingPersonViewModel != null) { PersonListItemViewModel.ConvertModelToViewModel(person, existingPersonViewModel); } else { People.Add(new PersonListItemViewModel(person)); _eventAggregator.GetEvent <UserActionHappenedEvent>().Publish("New person added"); } }
public static void ConvertModelToViewModel(Person model, PersonListItemViewModel viewModel) { viewModel.Lastname = model.Lastname; }