private void pnl_Account_Click(object sender, int idtemplate) { crud_modal.Visibility = Visibility.Visible; cntrl.Curd.Accounting_template Accounting_template = new cntrl.Curd.Accounting_template(); Accounting_template.operationMode = cntrl.Class.clsCommon.Mode.Edit; Accounting_template.accounting_templateobject = entity.db.accounting_template.Where(x => x.id_template == idtemplate).FirstOrDefault(); //app_accountViewSource.View.MoveCurrentTo(); //account.objCollectionViewSource = app_accountViewSource; //account.entity = entity; crud_modal.Children.Add(Accounting_template); }
private void btnNew_Click(object sender, RoutedEventArgs e) { crud_modal.Visibility = Visibility.Visible; cntrl.Curd.Accounting_template Accounting_template = new cntrl.Curd.Accounting_template(); Accounting_template.operationMode = cntrl.Class.clsCommon.Mode.Add; //app_account app_account = new app_account(); //entity.db.app_account.Add(app_account); //account.accountobject = app_account; // app_accountViewSource.View.MoveCurrentToLast(); //account.objCollectionViewSource = app_accountViewSource; //account.entity = entity; crud_modal.Children.Add(Accounting_template); }