private void pnl_Curd_linkEdit_click(object sender, int intId) { crud_modal.Visibility = Visibility.Visible; cntrl.Curd.Contact_Role objcontact_role = new cntrl.Curd.Contact_Role(); contact_roleViewSource.View.MoveCurrentTo(entity.db.contact_role.Where(x => x.id_contact_role == intId).FirstOrDefault()); objcontact_role.objCollectionViewSource = contact_roleViewSource; objcontact_role.entity = entity; crud_modal.Children.Add(objcontact_role); }
private void btnNew_Click(object sender, RoutedEventArgs e) { crud_modal.Visibility = Visibility.Visible; cntrl.Curd.Contact_Role objcontact_role = new cntrl.Curd.Contact_Role(); contact_role contact_role = new contact_role(); entity.db.contact_role.Add(contact_role); contact_roleViewSource.View.MoveCurrentToLast(); objcontact_role.objCollectionViewSource = contact_roleViewSource; objcontact_role.entity = entity; crud_modal.Children.Add(objcontact_role); }