public DVCCategory (string category, int numberOfPics) : base (null, true) { Category = category; var section = new Section (); for (int picNumber = 1; picNumber <= numberOfPics; picNumber++) { var picNo = picNumber; var picName = string.Format ("{0} {1}", category, picNumber); section.Add (new StringElement (picName, ()=> { var animalView = new AnimalViewController (Category, picNo); NavigationController.PushViewController (animalView, true); })); } Root = new RootElement (Category) { section }; }
public DVCCategory(string category, int numberOfPics) : base(null, true) { Category = category; var section = new Section(); for (int picNumber = 1; picNumber <= numberOfPics; picNumber++) { var picNo = picNumber; var picName = string.Format("{0} {1}", category, picNumber); section.Add(new StringElement(picName, () => { var animalView = new AnimalViewController(Category, picNo); NavigationController.PushViewController(animalView, true); })); } Root = new RootElement(Category) { section }; }
// Refresh UI void AddAnimals() { // Get your Container User-Defined Variables defined on Tag Manager var adjective = AppDelegate.Container.StringForKey("Adjective"); // Create the new section with the new values retreived var section = new Section($"{adjective} {category}"); for (uint picNumber = 1; picNumber <= numberOfPics; picNumber++) { var picNo = picNumber; string picName = $"{adjective} {category} {picNumber}"; section.Add(new StringElement(picName, () => { var animalView = new AnimalViewController(category, picNo); NavigationController.PushViewController(animalView, true); })); } Root.Clear(); Root.Add(section); }