Exemplo n.º 1
0
    private void AddRootToPrimaryMenu(NavigationItems navItems)
    {
      if (!this.IncludeInNavigation(this.NavigationRoot))
      {
        return;
      }

      var navigationItem = this.CreateNavigationItem(this.NavigationRoot, 0, 0);
      //Root navigation item is only active when we are actually on the root item
      navigationItem.IsActive = this.ContextItem.ID == this.NavigationRoot.ID;
      navItems?.Items?.Insert(0, navigationItem);
    }
Exemplo n.º 2
0
    public NavigationItems GetBreadcrumb()
    {
      var items = new NavigationItems
      {
        Items = this.GetNavigationHierarchy(true).Reverse().ToList()
      };

      for (var i = 0; i < items.Items.Count - 1; i++)
      {
        items.Items[i].Level = i;
      }

      return items;
    }