private void AddButton_Click(object sender, RoutedEventArgs e) { HostingUnit.Owner = Host.Person.Id; // HostingUnit.Area = (BO.Location)MyDictionary.TranslatStringeToEnum(areaComboBox.SelectedItem.ToString()); try { HostingUnit.Key = bl.AddHostingUnit(HostingUnit); Host = bl.GetHost(Host.Person.Id); } catch (DuplicateWaitObjectException exp) { MessageBox.Show(exp.Message); return; } catch (MissingMemberException ex) { MessageBox.Show(ex.Message); return; } MessageBox.Show("היחידה הוספה בהצלחה"); LB.ItemsSource = Host.HostingUnits; LB.Items.Refresh(); NavigationService.GoBack(); }