protected virtual void OnEditContactClicked(PhoneBook.ViewModels.Contacts.Model.Contact contact)
 {
     if (EditContactClicked != null)
     {
         var args = new ContactEventArgs
         {
             Contact    = contact,
             PhoneTypes = _phoneTypes,
         };
         EditContactClicked(this, args);
     }
 }
 public ContactViewModel(Contacts.Model.Contact contact, List <City> cities, List <PhoneType> phoneTypes)
 {
     _contact          = contact;
     _cities           = cities;
     _phoneTypes       = phoneTypes;
     _phoneIdsToDelete = new List <int>();
     SelectedPhone     = _contact.PhoneNumbers.FirstOrDefault();
     _contactPhones    = new ObservableCollection <Phone>();
     foreach (var phone in _contact.PhoneNumbers)
     {
         _contactPhones.Add(phone);
     }
     DeleteContactCommand = new RelayCommand(DeleteContact);
     EditClickedCommand   = new RelayCommand(OnEditClicked);
     AddPhoneCommand      = new RelayCommand(AddPhone);
     SaveCommand          = new RelayCommand(Save);
     DeletePhoneCommand   = new RelayCommand(DeletePhone);
 }