예제 #1
0
        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");
            }
        }
예제 #2
0
 public static void ConvertModelToViewModel(Person model, PersonListItemViewModel viewModel)
 {
     viewModel.Lastname = model.Lastname;
 }
 public static void ConvertModelToViewModel(Person model, PersonListItemViewModel viewModel)
 {
     viewModel.Lastname = model.Lastname;
 }