Exemplo n.º 1
0
        private void Add_Contact_btn_Click(object sender, RoutedEventArgs e)
        {
            AddContactWindow ACW1 = new AddContactWindow();

            ACW1.ShowDialog();

            contacts = DBH.getContacts();

            ContactsListItems.ItemsSource = contacts;

            MessageBox.Show("Contact successfully added.");
        }
Exemplo n.º 2
0
 private void AddOrEditBtn_Click(object sender, RoutedEventArgs e)
 {
     if (sender == add)
     {
         AddContactWindow contactWindow = new AddContactWindow(this);
         contactWindow.Show();
         add.IsEnabled  = false;
         edit.IsEnabled = false;
     }
     else if (sender == edit)
     {
         if (contacts.SelectedItem != null)
         {
             AddContactWindow contactWindow = new AddContactWindow(this, ContactsInformation.GetContact(contacts.SelectedItem.ToString()));
             contactWindow.Show();
             add.IsEnabled  = false;
             edit.IsEnabled = false;
         }
     }
 }