Ejemplo n.º 1
0
        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);
        }
Ejemplo n.º 2
0
 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;
 }
Ejemplo n.º 3
0
 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>()
             }
         }
     };
 }
Ejemplo n.º 4
0
 public void WillHideViewController(UISplitViewController splitController, UIViewController viewController, UIBarButtonItem barButtonItem, UIPopoverController popoverController)
 {
     barButtonItem.Title = NSBundle.MainBundle.LocalizedString("Master", "Master");
     NavigationItem.SetLeftBarButtonItem(barButtonItem, true);
     masterPopoverController = popoverController;
 }