//using the reflection api to edit a single bank void EditBank(Bank bank) { var context = new BindingContext (this, bank, "Edit " + bank.Name); //make a dialog view controller (UITableView descendant) var dvc = new DialogViewController (context.Root, true); //setup a button, so we can have a save function dvc.NavigationItem.RightBarButtonItem = new UIBarButtonItem (UIBarButtonSystemItem.Save, (o,e) => { context.Fetch(); NavigationController.PopViewControllerAnimated(true); ReloadData(); }); NavigationController.PushViewController (dvc, true); }
//build a single bank element Element BuildBankElement(Bank bank) { var element = new BankElement (bank); element.Tapped += () => EditBank (bank); return element; }