private void ModifyCustomer(Customer customer) { if (customer == null) { return; } var view = new EditCustomerView(); var viewModel = (view.DataContext as EditCustomerViewModel); viewModel.Customer = ObjectUtility.DeepCopy(customer); var result = view.ShowDialog(); if (result.Value) { this.Customers.Remove(customer); this.Customers.Add(viewModel.Customer); } }