private void DeleteHostingUnitBtn_Click(object sender, RoutedEventArgs e)//this takes us to delete the unit { try { ImpBL bl = ImpBL.Instance; int unitKey = int.Parse(HostingUnitKeyLable.Content.ToString().Substring(1)); bl.DeleteHostingUnit(bl.GetHostingUnit(unitKey)); UserControlContainer.Visibility = Visibility.Collapsed; } catch (Exception err) { MessageBox.Show(err.Message, "Error", MessageBoxButton.OK, MessageBoxImage.Error); } }