ListItem
in namespace DotVVM.Framework.Controls.Bootstrap4
Represents a single item in Bootstrap lists and menus.
Usage & Scenarios
A base class representing an item in Bootstrap lists and menus. This list item is used in the following controls:
- Breadcrumb uses 
<bs:BreadcrumbItem>. - DropDownButton uses 
<bs:DropDownButtonItem>. - ListGroup uses 
<bs:ListGroupItem>. - NavigationBar uses 
<bs:NavigationItem>. - ResponsiveNavigation uses 
<bs:NavigationItem>. 
All these controls use the following properties on its list items:
Textrepresents the text on the list item. Alternatively, you can useContentTemplateproperty to specify any HTML content.- If you set the 
NavigateUrlproperty, or you use theRouteName,Param-*,Query-*andUrlSuffixproperties, the item will behave like a hyperlink. For more information aboutRouteNameproperties, see RouteLink control. - Alternatively, you can set the 
Clickcommand which specifies the method in the viewmodel to be triggered. Enabledproperty can be used to enable or disable the list item.IsSelectedproperty specifies whether the list item is active or not.
Properties
| Name | Type | Description | Notes | Default Value | |
|---|---|---|---|---|---|
| ClientIDMode | ClientIDMode | Gets or sets the client ID generation algorithm. | 
                                         attribute 
                                        
                                        static value 
                                        
                                        
                                     | 
                                    Static | |
| ContentTemplate | ITemplate | Gets or sets the template for content of the item. | 
                                        
                                         inner element 
                                        static value 
                                        
                                        default 
                                     | 
                                    null | |
| DataContext | Object | Gets or sets a data context for the control and its children. All value and command bindings are evaluated in context of this value. The DataContext is null in client-side templates. | 
                                         attribute 
                                        
                                        
                                        bindable 
                                        
                                     | 
                                    null | |
| Enabled | Boolean | Gets or sets whether this item is enabled. | 
                                         attribute 
                                        
                                        static value 
                                        bindable 
                                        
                                     | 
                                    True | |
| ID | String | Gets or sets the control client ID within its naming container. | 
                                         attribute 
                                        
                                        static value 
                                        bindable 
                                        
                                     | 
                                    null | |
| IncludeInPage | Boolean | Gets or sets whether the control is included in the DOM of the page. | 
                                         attribute 
                                        
                                        
                                        bindable 
                                        
                                     | 
                                    True | |
| InnerText | String | Gets or sets the inner text of the HTML element. Note that this property can only be used on HtmlGenericControl directly and when the control does not have any children. | 
                                         attribute 
                                        
                                        static value 
                                        bindable 
                                        
                                     | 
                                    null | |
| IsSelected | Boolean | Gets or sets whether this item is selected. | 
                                         attribute 
                                        
                                        static value 
                                        bindable 
                                        
                                     | 
                                    False | |
| NavigateUrl | String | Gets or sets the URL of the item hyperlink. | 
                                         attribute 
                                        
                                        static value 
                                        bindable 
                                        
                                     | 
                                    ||
| RouteName | String | Gets or sets the name of the route for the item hyperlink. | 
                                         attribute 
                                        
                                        static value 
                                        
                                        
                                     | 
                                    null | |
| Text | String | Gets or sets the text of the item. | 
                                         attribute 
                                        
                                        static value 
                                        bindable 
                                        
                                     | 
                                    ||
| UrlSuffix | String | Gets or sets the suffix that will be appended to the generated URL. | 
                                         attribute 
                                        
                                        static value 
                                        bindable 
                                        
                                     | 
                                    null | |
| Visible | Boolean | Gets or sets whether the control is visible. When set to false, `style="display: none"` will be added to this control. | 
                                         attribute 
                                        
                                        
                                        bindable 
                                        
                                     | 
                                    True | 
Events
| Name | Type | Description | |
|---|---|---|---|
| Click | Command | Gets or sets the command that will be triggered when the button is clicked. |