private void pnlDeleteInspector_MouseUp(object sender, MouseButtonEventArgs e) { if (lstVInspectors.SelectedIndex != -1) { var inspSelected = (Inspector)lstVInspectors.SelectedValue; IPersistence<Inspector> servInsp = new Persistence<Inspector>(); servInsp.DeleteEntity(inspSelected); App.Single.RemoveWork(inspSelected); InspectorsRefresh(inspSelected); } else { MessageBox.Show("Por favor, seleccione un inspector de la lista"); } }