private void onDataGridViewMouseDoubleClick(object sender, MouseButtonEventArgs e)
 {
     var dialog = new ContactsEditor((Contact)DataGridView.SelectedItem);
     ModalDialog = dialog;
     dialog.Closed += onEditDialogClosed;
     dialog.Show();
 }
 private void onAddButtonClick(object sender, RoutedEventArgs e)
 {
     var dialog = new ContactsEditor();
     ModalDialog = dialog;
     dialog.Closed += onEditDialogClosed;
     dialog.Show();
 }
        private void onContactsListViewMouseDoubleClick(object sender, MouseButtonEventArgs e)
        {
            if (ContactsListView.SelectedItem == null || e.ChangedButton != MouseButton.Left) return;

            var dialog = new ContactsEditor((Contact)ContactsListView.SelectedItem);
            ModalDialog = dialog;
            dialog.Closed += onEditDialogClosed;
            dialog.Show();
        }
 private void onEditButtonClick(object sender, RoutedEventArgs e)
 {
     var dialog = new ContactsEditor((Contact)ContactsListView.SelectedItem);
     ModalDialog = dialog;
     dialog.Closed += onEditDialogClosed;
     dialog.Show();
 }