NavigationItemBuilder¶
Fluent builder base for configuring a NavigationItem<T>-derived item; each setter clears and repopulates its target dictionary or field before returning this (or TBuilder) so calls can be chained.
Purpose¶
- Fluent builder base for configuring a
NavigationItem<T>-derived item; each setter clears and repopulates its target dictionary or field before returningthis(orTBuilder) so calls can be chained.
Context¶
- Namespace:
SAIF.Web.Mvc.UI - Assembly/package:
SAIF.Framework.Web.Mvc (source-shipping NuGet package) - Kind: abstract class (generic, TItem, TBuilder)
Public members¶
| Member | Signature | Purpose |
|---|---|---|
| ViewContext | public ViewContext ViewContext { get; set; } |
Auto-property holding the MVC view context; not populated by the constructor (the constructor's viewContext parameter is unused), so it is null unless a caller sets it explicitly.* |
| Action(RouteValueDictionary) | public TBuilder Action(RouteValueDictionary routeValues) |
Accepts route values for action-based navigation but returns this without storing them — a no-op overload. |
| Action(string, string) | public TBuilder Action(string actionName, string controllerName) |
Forwards to Action(actionName, controllerName, (object)null); the underlying three-argument overload is also a no-op. |
| Action(string, string, object) | public TBuilder Action(string actionName, string controllerName, object routeValues) |
Accepts an action/controller/route-values combination but returns this without storing them — a no-op overload. |
| Action(string, string, RouteValueDictionary) | public TBuilder Action(string actionName, string controllerName, RouteValueDictionary routeValues) |
Accepts an action/controller/route-values combination but returns this without storing them — a no-op overload. |
| Enabled(bool) | public TBuilder Enabled(bool value) |
Sets the wrapped item's Enabled flag, then returns the typed builder to continue the fluent chain. |
| HtmlAttributes(object) | public TBuilder HtmlAttributes(object attributes) |
Converts the anonymous object to a dictionary and delegates to the IDictionary<string, object> overload. |
| HtmlAttributes(IDictionary<string, object>) | public TBuilder HtmlAttributes(IDictionary<string, object> attributes) |
Clears the item's HtmlAttributes and merges in the supplied dictionary, then returns the typed builder. |
| Id(string) | public TBuilder Id(string value) |
Sets the item's Id, then returns the typed builder to continue the fluent chain. |
| ImageHtmlAttributes(object) | public TBuilder ImageHtmlAttributes(object attributes) |
Converts the anonymous object to a dictionary and delegates to the IDictionary<string, object> overload. |
| ImageHtmlAttributes(IDictionary<string, object>) | public TBuilder ImageHtmlAttributes(IDictionary<string, object> attributes) |
Clears the item's ImageHtmlAttributes and merges in the supplied dictionary, then returns the typed builder. |
| ImageUrl(string) | public TBuilder ImageUrl(string value) |
Sets the item's ImageUrl, then returns the typed builder to continue the fluent chain. |
| LinkHtmlAttributes(object) | public TBuilder LinkHtmlAttributes(object attributes) |
Converts the anonymous object to a dictionary and delegates to the IDictionary<string, object> overload. |
| LinkHtmlAttributes(IDictionary<string, object>) | public TBuilder LinkHtmlAttributes(IDictionary<string, object> attributes) |
Clears the item's LinkHtmlAttributes and merges in the supplied dictionary, then returns the typed builder. |
| Route(string, object) | public TBuilder Route(string routeName, object routeValues) |
Accepts a named route and route values but returns this without storing them — a no-op overload. |
| Route(string, RouteValueDictionary) | public TBuilder Route(string routeName, RouteValueDictionary routeValues) |
Accepts a named route and route values but returns this without storing them — a no-op overload. |
| Text(string) | public TBuilder Text(string value) |
Sets the item's Text, then returns the typed builder to continue the fluent chain. |
| Tooltip(string) | public TBuilder Tooltip(string value) |
Sets the item's Tooltip, then returns the typed builder to continue the fluent chain. |
| Url(string) | public TBuilder Url(string value) |
Sets the item's Url, then returns the typed builder to continue the fluent chain. |
| Visible(bool) | public TBuilder Visible(bool value) |
Sets the item's Visible flag, then returns the typed builder to continue the fluent chain. |
Behavioral notes¶
- All
ActionandRouteoverloads returnthis/TBuilderwithout storing the supplied value, so routing configuration through this fluent API currently has no effect (see the architecture findings' "Architectural observations").** ViewContextis never assigned by the constructor even though aViewContextparameter is accepted there; the property remainsnullunless a caller sets it directly.*
Note: Statements marked with * were inferred from code structure, naming conventions, or contextual evidence where direct confirmation was not available in source artifacts. Statements marked with ** could not be confirmed; treat as unknown until verified.
Sources¶
src/Web.Mvc/UI/NavigationItemBuilder.cs