public void ShowAddScreeen()
		{
			var artScreen = new ArtScreen(screen => {
				Art a = screen.art;
				JaktLoggApp.instance.SaveArtItem(a);
				TableView.ReloadData();
			});
			NavigationController.PushViewController(artScreen, true);
		}
Esempio n. 2
0
		public ArtTableSource(ArtScreen controller, Art j)
		{
			_controller = controller;
			_art = j;

			CellDelete = new CellDeleteButton(HandleDeleteButtonTouchUpInside);
			NSBundle.MainBundle.LoadNib("CellDeleteButton", CellDelete, null);
			delcell = CellDelete.Cell;

			var sectionArt = new SectionMapping("", "");
			var sectionSlett = new SectionMapping("", "");
			
			sections.Add(sectionArt);
			sections.Add(sectionSlett);
			
			sectionArt.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("specie.name"),
				GetValue = () => {
					return _art.Navn;
				},
				RowSelected = () => {
					var fieldScreen = new FieldStringScreen(Utils.Translate("specie.name"), screen => {
						_art.Navn = Utils.UppercaseFirst(screen.Value);
						_controller.Refresh();
					}); 
					fieldScreen.Value = _art.Navn;
					_controller.NavigationController.PushViewController(fieldScreen, true);
				}
			});
			
			sectionArt.Rows.Add(new RowItemMapping {
				Label = Utils.Translate("specie.wikiword"),
				GetValue = () => {
					return _art.Wikinavn;
				},
				RowSelected = () => {
					var fieldScreen = new FieldStringScreen(Utils.Translate("specie.wikiword"), screen => {
						_art.Wikinavn = screen.Value;
						_controller.Refresh();
					}); 
					fieldScreen.Value = _art.Wikinavn;
					_controller.NavigationController.PushViewController(fieldScreen, true);
				}
			});
			
			
			
			if(!_controller.IsNewItem){
				sectionSlett.Rows.Add(new RowItemMapping {
					Label = Utils.Translate("specie.delete"),
					GetValue = () => {
						return "";
					}
				});
			}
		}