DOT

VVM

 DOCS

Version: 1.0 | 1.1 |

NavigationItem

in namespace DotVVM.Framework.Controls.Bootstrap

Properties

Name Type Description Notes Default Value
ClientIDMode ClientIDMode Gets or sets the client ID generation algorithm.
attribute
inner element
static value
bindable
default
1
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.
attribute
inner element
static value
bindable
default
ID String Gets or sets the unique control ID.
attribute
inner element
static value
bindable
default
InnerText String Gets or sets the inner text of the HTML element.
attribute
inner element
static value
bindable
default
IsDisabled Boolean Gets or sets whether this item is disabled.
attribute
inner element
static value
bindable
default
False
IsSelected Boolean Gets or sets whether this item is selected.
attribute
inner element
static value
bindable
default
False
NavigateUrl String Gets or sets the URL of the item hyperlink.
attribute
inner element
static value
bindable
default
RouteName String Gets or sets the name of the route for the item hyperlink.
attribute
inner element
static value
bindable
default
Text String Gets or sets the text of the item.
attribute
inner element
static value
bindable
default
UrlSuffix String Gets or sets the suffix that will be appended to the generated URL.
attribute
inner element
static value
bindable
default
Visible Boolean Gets or sets whether the control is visible.
attribute
inner element
static value
bindable
default
True

Events

Name Type Description
Click Action Gets or sets the command that will be triggered when the button is clicked.

Usage & Scenarios

This control is used as a list item inside the NavigationBar control.

http://getbootstrap.com/components/#nav

HTML Rendered by the Control

Sample 1: Basic Usage

The NavigationItem control has the NavigateUrl property which specifies target URL, or the Click property which invokes a command on the viewmodel.

The Text property defines the contents of the item. Alternatively, you can also place the contents inside the control.

The IsSelected and IsDisabled properties define whether the control gets the active or disabled CSS classes.

<bs:NavigationBar Type="Pills">
    <bs:NavigationItem NavigateUrl="https://www.google.com/" 
                            Text="Google" 
                            IsSelected="true" />

    <bs:NavigationItem Click="{command: Increment()}" Text="{value: Likes + ' likes'}" />

    <bs:NavigationItem NavigateUrl="http://www.w3schools.com/html/" 
                            Text="W3 Schools" 
                            IsDisabled="true" />
</bs:NavigationBar>
using System.Collections.Generic;
using System.Linq;

namespace Dotvvm.Samples.NavigationItem.sample1
{
    public class ViewModel
    {

        public int Likes { get; set; }

        public void Increment()
        {
            Likes++;
        }            
    }
}

Suggestions


Help & Contribute

The documentation is maintained on GitHub.
We'll be happy if you edit the page and create a pull request.

Send message