/// <summary> /// Shows the Detals window in Delete mode /// </summary> /// <param name="CustId">The customer id</param> public void DeleteCustomer(int CustId) { try { CustomerDetailsView cdv = new CustomerDetailsView( CustomerDetailsMode.Delete, this.Emp.DefaultIfEmpty(null). FirstOrDefault(item => item.CustomerId.Equals(CustId))); cdv.ShowDialog(); updateView(); } catch (Exception ex) { ExceptionHelper.Handle(ex); } }
public void Execute(object a_parameter) { Customer customer = a_parameter as Customer; CustomerDetailsViewModel viewModel = customer != null ? new CustomerDetailsViewModel(customer) : new CustomerDetailsViewModel(); CustomerDetailsView editView = new CustomerDetailsView { DataContext = viewModel }; editView.ShowDialog(); if (AfterExecuted != null) { AfterExecuted.Invoke(viewModel.CurrentCustomer); } }