public override UIView GetViewForHeader (UITableView tableView, int section) { if(section == 0 && _jeger.ID > 0){ var headerJegerView = new HeaderJeger(_jeger); headerJegerView.HandleButtonImageTouchUpInside = HandleButtonImageTouchUpInside; return headerJegerView.View; } return tableView.TableHeaderView; }
public JegerItemTableSource(JegerScreen controller, Jeger j) { _controller = controller; _jeger = j; CellDelete = new CellDeleteButton(HandleDeleteButtonTouchUpInside); NSBundle.MainBundle.LoadNib("CellDeleteButton", CellDelete, null); delcell = CellDelete.Cell; headerJegerView = new HeaderJeger(_jeger); headerJegerView.HandleButtonImageTouchUpInside = HandleButtonImageTouchUpInside; var sectionJeger = new SectionMapping("", ""); var sectionSlett = new SectionMapping("", ""); sections.Add(sectionJeger); sections.Add(sectionSlett); sectionJeger.Rows.Add(new RowItemMapping { Label = Utils.Translate("jeger.firstname"), GetValue = () => { return _jeger.Fornavn; }, RowSelected = () => { var fieldScreen = new FieldStringScreen(Utils.Translate("jeger.firstname"), screen => { _jeger.Fornavn = Utils.UppercaseFirst(screen.Value); _controller.Refresh(); }); fieldScreen.Value = _jeger.Fornavn; _controller.NavigationController.PushViewController(fieldScreen, true); } }); sectionJeger.Rows.Add(new RowItemMapping { Label = Utils.Translate("jeger.lastname"), GetValue = () => { return _jeger.Etternavn; }, RowSelected = () => { var fieldScreen = new FieldStringScreen(Utils.Translate("jeger.lastname"), screen => { _jeger.Etternavn = Utils.UppercaseFirst(screen.Value); _controller.Refresh(); }); fieldScreen.Value = _jeger.Etternavn; _controller.NavigationController.PushViewController(fieldScreen, true); } }); /* sectionJeger.Rows.Add(new RowItemMapping { Label = "Telefon", GetValue = () => { return _jeger.Phone; }, RowSelected = () => { var fieldScreen = new FieldStringScreen("Telefon", screen => { _jeger.Phone = screen.Value; _controller.Refresh(); }); fieldScreen.Value = _jeger.Phone; fieldScreen.KeyboardType = UIKeyboardType.PhonePad; _controller.NavigationController.PushViewController(fieldScreen, true); } });*/ sectionJeger.Rows.Add(new RowItemMapping { Label = Utils.Translate("jeger.profilepicture"), GetValue = () => { return _jeger.ImagePath.Length > 0 ? Utils.Translate("picture.showimage") : Utils.Translate("picture.addimage"); }, RowSelected = () => { ShowImageView(); }, ImageFile = "Images/Icons/camera.png" }); sectionJeger.Rows.Add(new RowItemMapping { Label = Utils.Translate("jeger.email"), GetValue = () => { return _jeger.Email; }, RowSelected = () => { var fieldScreen = new FieldStringScreen("E-post", screen => { _jeger.Email = screen.Value; _controller.Refresh(); }); fieldScreen.Value = _jeger.Email; fieldScreen.KeyboardType = UIKeyboardType.EmailAddress; _controller.NavigationController.PushViewController(fieldScreen, true); } }); if(!_controller.IsNewItem){ sectionSlett.Rows.Add(new RowItemMapping { Label = Utils.Translate("jeger.delete"), GetValue = () => { return ""; } }); } }