private void Excluir_Click(object sender, RoutedEventArgs e) { try { var Id = _controlManager.GetIdToRemove(); if (!String.IsNullOrEmpty(Id)) { switch (currentStatus) { case "Vacuum": _vacuums.deleveValue(Convert.ToInt32(Id)); break; case "Pressure": _pressures.deleveValue(Convert.ToInt32(Id)); break; case "Temperature": _temperatures.deleveValue(Convert.ToInt32(Id)); break; default: throw new FormatException("Data Type Not Found"); } } } catch (Exception ex) { MessageBox.Show("An error has occured:" + ex.Message, "Erro", MessageBoxButton.OK, MessageBoxImage.Error); } }