예제 #1
0
        private void OnRemovePersonExecute()
        {
            Person personToRemove = SelectedAddedPerson;

            Meeting.Model.Persons.Remove(personToRemove);
            AddedPersons.Remove(personToRemove);
            AvailablePersons.Add(personToRemove);
            HasChanges = _meetingRepository.HasChanges();
            ((DelegateCommand)SaveCommand).RaiseCanExecuteChanged();
        }
예제 #2
0
        private void SetupPicklist()
        {
            List <int> meetingPersonIds = Meeting.Model.Persons.Select(p => p.Id).ToList();
            var        addedPersons     = _allPersons.Where(x => meetingPersonIds.Contains(x.Id)).OrderBy(p => p.FirstName);
            var        availablePersons = _allPersons.Except(addedPersons).OrderBy(p => p.FirstName);

            AddedPersons.Clear();
            AvailablePersons.Clear();
            foreach (var addedPerson in addedPersons)
            {
                AddedPersons.Add(addedPerson);
            }
            foreach (var availablePerson in availablePersons)
            {
                AvailablePersons.Add(availablePerson);
            }
        }