private void listView_doubleClicked(object sender, RoutedEventArgs e) { if (nameList.SelectedIndex != -1) { Contact contactToEdit = contactList.ElementAt(nameList.SelectedIndex); ContactWindow editContactWindow = new ContactWindow(table); editContactWindow.EditMode = true; editContactWindow.setButtonName("Save Changes"); editContactWindow.Contact = contactToEdit; editContactWindow.Title = String.Format("Edit Contact for {0} {1}", contactToEdit.FirstName, contactToEdit.LastName); editContactWindow.ShowDialog(); editContactWindow.Focus(); this.Focusable = false; nameList.ItemsSource = contactList; listView_Selected(sender, e); } }
private void onClickAddBtn(object sender, RoutedEventArgs e) { ContactWindow newWindow = new ContactWindow(table); newWindow.ShowDialog(); newWindow.Focus(); this.Focusable = false; contactList = ContactDisplay.DoPost(table); nameList.ItemsSource = contactList; }