Exemplo n.º 1
0
        private void RemoveContactPhoneMethod(object parameter)
        {
            if (_selectedContactPhone != null && _selectedContact != null)
            {
                _selectedContact.ContactPhones.Remove(_selectedContactPhone);
                _selectedContactPhone = null;

                // needed because SelectionChanged event is not raised by the grid
                // properly
                if (_selectedContact != null && _selectedContact.ContactPhones.Count > 0)
                {
                    View.ContactsPhonesGrid.SelectedItem = null;
                    View.ContactsPhonesGrid.SelectedItem = _selectedContact.ContactPhones[0];
                }
                RemoveContactPhoneCommand.RaiseCanExecuteChanged();
            }
        }
Exemplo n.º 2
0
 private void SelectContactPhoneMethod(object parameter)
 {
     _selectedContactPhone = parameter as CompanyContactPhone;
     RemoveContactPhoneCommand.RaiseCanExecuteChanged();
 }