private void btn_Click_Edit_Customer(object sender, RoutedEventArgs e) { if (CustomerGrid.SelectedItems.Count == 1) { CustomerViewModel rowViewModel = CustomerGrid.SelectedItem as CustomerViewModel; CustomerDetailWindow detailWindow = new CustomerDetailWindow(); detailWindow.DataContext = rowViewModel.Clone();; DataGridViewModel gridViewModel = (DataGridViewModel)this.DataContext; rowViewModel.ParentGrid = gridViewModel; rowViewModel.DetailWindowDatacontext = detailWindow.DataContext; CustomerGrid.UnselectAllCells(); bool?result = detailWindow.ShowDialog(); } else { ShowMessageDialog("Kunde bearbeiten - Info", "Ein Datensatz muss zuvor selektiert werden", MessageDialogStyle.Affirmative); } }