コード例 #1
0
            public Task ConfigureMenuAsync(MenuConfigurationContext context)
            {
                if (context.Menu.Name != MenuName)
                {
                    return(Task.CompletedTask);
                }

                var products = new ApplicationMenuItem("Products", "Products", "/products");

                context.Menu.Items.Add(products);

                products.AddItem(new ApplicationMenuItem("AspNetZero", "AspNetZero", url: "/products/aspnetzero"));

                products.AddItem(new ApplicationMenuItem("ABP", "ABP", url: "/products/abp"));

                return(Task.CompletedTask);
            }
コード例 #2
0
 /// <summary>
 /// Adds a <see cref="ApplicationMenuItem"/> to <see cref="Items"/>.
 /// </summary>
 /// <param name="menuItem"><see cref="ApplicationMenuItem"/> to be added</param>
 /// <returns>This <see cref="ApplicationMenuItem"/> object</returns>
 public ApplicationMenuItem AddItem([NotNull] ApplicationMenuItem menuItem)
 {
     Items.Add(menuItem);
     return(this);
 }