static string Load(NavigationItem navItem, int level = 0) { string output = ""; // Don't display anything for the root label if (navItem.Label != "Root") { output += GenerateTabs(level) + navItem.Label + '\n'; // Increment the indention level for the next loop level++; } // Recurse the rest of the navigation items foreach (NavigationItem child in navItem.Children) { output += Load(child, level); } // Return the output string return(output); }
public void WillShowViewController(UISplitViewController svc, UIViewController vc, UIBarButtonItem button) { // Called when the view is shown again in the split view, invalidating the button and popover controller. NavigationItem.SetLeftBarButtonItem(null, true); masterPopoverController = null; }
static void LoadNavigationItems() { Root = new NavigationItem { Label = "Root", Url = "http://sample.com", Children = new List <NavigationItem> { new NavigationItem { Label = "Products", Url = "/products", Children = new List <NavigationItem> { new NavigationItem { Label = "Dish Soap", Url = "/dish-soap", Children = new List <NavigationItem>() }, new NavigationItem { Label = "Laundry Detergent", Url = "/laundry-detergent", Children = new List <NavigationItem>() }, new NavigationItem { Label = "Napkins", Url = "/napkins", Children = new List <NavigationItem>() } } }, new NavigationItem { Label = "Locations", Url = "/locations", Children = new List <NavigationItem> { new NavigationItem { Label = "New York", Url = "/new-york", Children = new List <NavigationItem> { new NavigationItem { Label = "Bronx", Url = "/bronx", Children = new List <NavigationItem>() }, new NavigationItem { Label = "Manhattan", Url = "/manhattan", Children = new List <NavigationItem>() }, new NavigationItem { Label = "Queens", Url = "/queens", Children = new List <NavigationItem>() } } } } }, new NavigationItem { Label = "Support", Url = "/support", Children = new List <NavigationItem>() } } }; }
public void WillHideViewController(UISplitViewController splitController, UIViewController viewController, UIBarButtonItem barButtonItem, UIPopoverController popoverController) { barButtonItem.Title = NSBundle.MainBundle.LocalizedString("Master", "Master"); NavigationItem.SetLeftBarButtonItem(barButtonItem, true); masterPopoverController = popoverController; }