Ejemplo n.º 1
0
        public void removePersonAction(object toRemove)
        {
            //if (_selectedPerson != null)
            //{

            Console.WriteLine((toRemove as Person).Name);
            var forRemoval = (toRemove as Person);
            int pos = Math.Max(PeopleList.IndexOf(forRemoval), 1);
            PeopleList.removePerson(forRemoval);
            SelectedPerson = (PeopleList.Count > pos - 1) ? PeopleList[pos - 1] : null;

            //    RemovePersonCommand.RaiseCanExecuteChanged();
            //}
        }
Ejemplo n.º 2
0
 //public Action addPersonAction = PeopleViewModel.addPerson();
 public void removeSelectedPersonAction()
 {
     //if (_selectedPerson != null)
     //{
     PeopleList.removePerson(SelectedPerson);
     if (PeopleList.Count > 0)
         SelectedPerson = PeopleList[0];
     else
         SelectedPerson = null;
     //}
 }