private void addCase_Click(object sender, RoutedEventArgs e) { selectCitizen sc = new selectCitizen(); if(sc.ShowDialog() ?? false) { ObservableCollection<Citizen> cns = (ObservableCollection<Citizen>)this.CaseRelatedPersonList.ItemsSource; if (cns == null) { cns = new ObservableCollection<Citizen>(); } Citizen c = (Citizen)sc.Addo; cns.Add(c); this.CaseRelatedPersonList.ItemsSource = cns; } }
private void changePerson_Click(object sender, RoutedEventArgs e) { selectCitizen sc = new selectCitizen(); if (sc.ShowDialog() ?? false) { Citizen c = (Citizen)sc.Addo; themanager = c; this.CarOfPersonID.Text = c.PKID; } }