Defines the fluent interface for configuring navigation items
Definition
Namespace:Kendo.Mvc.UI.Fluent
Assembly:Kendo.Mvc.dll
Type Parameters:
TItem
The type of the item.
TBuilder
The type of the builder.
Syntax:
public abstract class NavigationItemBuilder<TItem, TBuilder> where TItem : NavigationItem<TItem> where TBuilder : NavigationItemBuilder<TItem, TBuilder>
Inheritance: objectNavigationItemBuilder<TItem, TBuilder>
Derived Classes:
Inherited Members
Constructors
Initializes a new instance of the NavigationItemBuilder<TItem, TBuilder> class.
protected NavigationItemBuilder(NavigationItem<TItem> item, ViewContext viewContext)
The item.
viewContextViewContextThe view context.
Properties
Item
TItem
Gets or sets the Item.
protected TItem Item { get; }
Gets or sets the ViewContext.
public ViewContext ViewContext { get; set; }
Methods
Sets the action to which the item should navigate
public TBuilder Action(RouteValueDictionary routeValues)
The route values of the Action method.
Returns:TBuilder
Sets the action to which the item should navigate
public TBuilder Action(string actionName, string controllerName, RouteValueDictionary routeValues)
Name of the action.
controllerNamestringName of the controller.
routeValuesRouteValueDictionaryThe route values.
Returns:TBuilder
Makes the item navigate to the specified controllerAction method.
public TBuilder Action<TController>(Expression<Action<TController>> controllerAction) where TController : Controller
The action.
Returns:TBuilder
Sets the HTML content which the item should display.
public TBuilder Content(Action value)
The action which renders the content.
Returns:TBuilder
Sets the HTML content which the item should display as a string.
public TBuilder Content(string value)
The action which renders the content.
Returns:TBuilder
Sets the HTML attributes of the content element of the item.
public TBuilder ContentHtmlAttributes(IDictionary<string, object> attributes)
The attributes.
Returns:TBuilder
Sets the HTML attributes of the content element of the item.
public TBuilder ContentHtmlAttributes(object attributes)
The attributes.
Returns:TBuilder
Enables or disables the item. Disabled item cannot be clicked, expanded or open (depending on the item type - menu, tabstrip, panelbar).
Sets whether the Text property should be encoded when the item is rendered.
public TBuilder Encoded(bool isEncoded)
Whether the property should be encoded. Default: true.
Returns:TBuilder
Sets the HTML attributes applied to the outer HTML element rendered for the item
public TBuilder HtmlAttributes(IDictionary<string, object> attributes)
The attributes.
Returns:TBuilder
Sets the HTML attributes applied to the outer HTML element rendered for the item
public TBuilder HtmlAttributes(object attributes)
The attributes.
Returns:TBuilder
Sets the HTML attributes for the item image.
public TBuilder ImageHtmlAttributes(IDictionary<string, object> attributes)
The attributes.
Returns:TBuilder
Sets the HTML attributes for the item image.
public TBuilder ImageHtmlAttributes(object attributes)
The attributes.
Returns:TBuilder
Sets the URL of the image that should be displayed by the item.
LinkHtmlAttributes method.
public TBuilder LinkHtmlAttributes(IDictionary<string, object> attributes)
TBuilder
LinkHtmlAttributes method.
public TBuilder LinkHtmlAttributes(object attributes)
TBuilder
Sets the route to which the item should navigate.
public TBuilder Route(string routeName, RouteValueDictionary routeValues)
Name of the route.
routeValuesRouteValueDictionaryThe route values.
Returns:TBuilder
Sets the route to which the item should navigate.
public TBuilder Route(string routeName)
Name of the route.
Returns:TBuilder
Selects or unselects the item. By default items are not selected.
Sets the sprite CSS class names.
public TBuilder SpriteCssClasses(params string[] cssClasses)
The CSS classes.
Returns:TBuilder
Sets the text displayed by the item.
Returns the inner navigation item
public TItem ToItem()
TItem
Sets the URL to which the item should navigate
Sets the text displayed by the item.