private void UpdateButton_Click(object sender, RoutedEventArgs e) { try { bl.updateHostingUnit(hostingUnit); this.Close(); } catch (Exception ex) { MessageBox.Show(ex.Message); } }