Exemplo n.º 1
0
        /// <summary>
        /// Performs the DeleteContact command.
        /// </summary>
        /// <param name="parameter">The DeleteContact command parameter.</param>
        private void DoDeleteContactCommand(object parameter)
        {
            Contacts.Remove(SelectedContact);

            SelectedContact = null;
        }
Exemplo n.º 2
0
        /// <summary>
        /// Performs the AddContact command.
        /// </summary>
        /// <param name="parameter">The AddContact command parameter.</param>
        private void DoAddContactCommand(object parameter)
        {
            ContactViewModel newContact = new ContactViewModel()
            {
                Name = "New Contact"
            };

            Contacts.Add(newContact);

            SelectedContact = newContact;
        }