private void Add_New_Person_OnLoaded(object sender, RoutedEventArgs e) { Fill_Generic_Data fill = new Fill_Generic_Data(); ComboBoxLogic comboboxLogic = new ComboBoxLogic(); List<ph_tutors> tutor = new List<ph_tutors>(); TXTLogic txtLogic = new TXTLogic(); if (EditData == null) { _generic = new GenericPersonViewModel(); cmbUniversity.ItemsSource = comboboxLogic.Unis(); } else { _generic = fill.All(EditData.id); tutor = txtLogic.Tutor(EditData.id); // topic = txtLogic.Topic(editData.id); } cmbSpecialty.ItemsSource = comboboxLogic.SpecialtyList(); cmbUniversity.ItemsSource = comboboxLogic.Unis(); cmbCurrentMunicipality.ItemsSource = comboboxLogic.Regions(); cmbMunicipality.ItemsSource = comboboxLogic.Regions(); cmbGender.ItemsSource = comboboxLogic.Gender(); cmbCountry.ItemsSource = comboboxLogic.ReadCountry(); cmbEgnType.ItemsSource = comboboxLogic.Id_Types(); cmbAccReason.ItemsSource = comboboxLogic.AccReason(); cmbFormEdu.ItemsSource = comboboxLogic.FormEdu(); cmbTypeEdu.ItemsSource = comboboxLogic.Type(); cmbStatus.ItemsSource = comboboxLogic.Status(); cmbLastLevel.ItemsSource = comboboxLogic.Levels(); cmbLastEdu.ItemsSource = comboboxLogic.ReadCountry(); cmbUniversity.DataContext = EditData; dtgrdTutor.DataContext = tutor; // txtTopic.DataContext = topic; this.DataContext = _generic; //identitycards.un_persons = personView; }