private void ShowPersonDialogExecute()
 {
     IWindowService windowService = _container.Resolve<IWindowService>();
     var showPersonViewModel = new PersonViewModel(SelectedPerson);
     windowService.ShowDialog(showPersonViewModel);
 }
 private void editPersonViewModel_EditCanceled(object sender, EventArgs e)
 {
     EditPersonViewModel senderVM = (EditPersonViewModel)sender;
     SelectedPersonViewModel = new PersonViewModel(senderVM.Model);
     _eventAggregator.GetEvent<UserActionHappenedEvent>().Publish("Person edit canceled");
 }
Esempio n. 3
0
 public static void ConvertViewModelToModel(PersonViewModel viewModel, Person model)
 {
     model.Firstname = viewModel.Firstname;
     model.Lastname = viewModel.Lastname;
     model.PhoneNumber = viewModel.PhoneNumber;
 }
        private void PersonSelectionChanged(Tuple<Person, bool> payload)
        {
            if (payload.Item1 == null)
            {
                SelectedPersonViewModel = null;
                SelectedPerson = null;
                return;
            }

            SelectedPerson = payload.Item1;
            if (payload.Item2)
                SelectedPersonViewModel = new EditPersonViewModel(SelectedPerson, _container.Resolve<IValidationService>());
            else
                SelectedPersonViewModel = new PersonViewModel(SelectedPerson);
        }
Esempio n. 5
0
 public static void ConvertModelToViewModel(Person model, PersonViewModel viewModel)
 {
     viewModel.Firstname = model.Firstname;
     viewModel.Lastname = model.Lastname;
     viewModel.PhoneNumber = model.PhoneNumber;
 }