private void ContactListView_OnSelectionChanged(object sender, SelectionChangedEventArgs e) { if (contactListView.SelectedItem is Contact contact) { var updateWindows = new ContactDetailsWindow(contact); updateWindows.ShowDialog(); ReadDatabase(); } }
private void contactsListView_SelectionChanged(object sender, SelectionChangedEventArgs e) { ListView listView = sender as ListView; var selectedContact = listView.SelectedValue as Contact; if (selectedContact != null) { ContactDetailsWindow contactDetailsWindow = new ContactDetailsWindow(selectedContact); contactDetailsWindow.ShowDialog(); GetContacts(); FilterContacts(""); } }