public DVCMenu () : base (null) { Root = new RootElement ("Cute Animals") { new Section () { new StringElement ("Cute Monkey Pictures!", ()=> { var categoryView = new DVCCategory ("Monkey", 8); NavigationController.PushViewController (categoryView, true); }), new StringElement ("Cute Cat Pictures!", ()=> { var categoryView = new DVCCategory ("Cat", 4); NavigationController.PushViewController (categoryView, true); }), new StringElement ("Cute Bunny Pictures!", ()=> { var categoryView = new DVCCategory ("Bunny", 3); NavigationController.PushViewController (categoryView, true); }), new StringElement ("Cute Lion Pictures!", ()=> { var categoryView = new DVCCategory ("Lion", 4); NavigationController.PushViewController (categoryView, true); }), new StringElement ("Cute Tiger Pictures!", ()=> { var categoryView = new DVCCategory ("Tiger", 2); NavigationController.PushViewController (categoryView, true); }), } }; }
public DVCMenu() : base(null) { Root = new RootElement("Cute Animals") { new Section() { new StringElement("Cute Monkey Pictures!", () => { var categoryView = new DVCCategory("Monkey", 8); NavigationController.PushViewController(categoryView, true); }), new StringElement("Cute Cat Pictures!", () => { var categoryView = new DVCCategory("Cat", 4); NavigationController.PushViewController(categoryView, true); }), new StringElement("Cute Bunny Pictures!", () => { var categoryView = new DVCCategory("Bunny", 3); NavigationController.PushViewController(categoryView, true); }), new StringElement("Cute Lion Pictures!", () => { var categoryView = new DVCCategory("Lion", 4); NavigationController.PushViewController(categoryView, true); }), new StringElement("Cute Tiger Pictures!", () => { var categoryView = new DVCCategory("Tiger", 2); NavigationController.PushViewController(categoryView, true); }), } }; }
// Refresh UI void AddAnimals() { // Get your Container User-Defined Variables defined on Tag Manager var title = AppDelegate.Container.StringForKey("Title"); var adjective = AppDelegate.Container.StringForKey("Adjective"); Title = $"{adjective} {title}"; // Create the new section with the new values retreived var section = new Section($"{adjective} Animals") { new StringElement($"{adjective} Monkey Pictures!", () => { var categoryView = new DVCCategory("Monkey", 8); NavigationController.PushViewController(categoryView, true); }), new StringElement($"{adjective} Cat Pictures!", () => { var categoryView = new DVCCategory("Cat", 4); NavigationController.PushViewController(categoryView, true); }), new StringElement($"{adjective} Bunny Pictures!", () => { var categoryView = new DVCCategory("Bunny", 3); NavigationController.PushViewController(categoryView, true); }), new StringElement($"{adjective} Lion Pictures!", () => { var categoryView = new DVCCategory("Lion", 4); NavigationController.PushViewController(categoryView, true); }), new StringElement($"{adjective} Tiger Pictures!", () => { var categoryView = new DVCCategory("Tiger", 2); NavigationController.PushViewController(categoryView, true); }), }; Root.Clear(); Root.Add(section); }