private void ContactListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { Contact selectedContact = (Contact)contactListView.SelectedItem; if (selectedContact != null) { ContactDetailWindow contactDetailWindow = new ContactDetailWindow(selectedContact); contactDetailWindow.ShowDialog(); } }
private void lstContacts_SelectionChanged(object sender, SelectionChangedEventArgs e) { Contact selectedContact = (Contact)lstContacts.SelectedItem; if (selectedContact != null) { var contactDetailWindow = new ContactDetailWindow(selectedContact); contactDetailWindow.ShowDialog(); readDatabase(); } }