private void NewButton_Click(object sender, RoutedEventArgs e) { EditWindow editWindow = new EditWindow("New Contact"); editWindow.Show(); editWindow.Closed += EditWindow_Closed; }
private void EditButton_Click(object sender, RoutedEventArgs e) { if (!(ContactListBox.SelectedItem is null)) { ContactModel contact = ContactListBox.SelectedItem as ContactModel; EditWindow editWindow = new EditWindow("Edit Contact", contact); editWindow.Show(); editWindow.Closed += EditWindow_Closed; } }