LinkButton

in namespace DotVVM.Framework.Controls.Bootstrap4

Extends the built-in LinkButton control to allow applying Bootstrap CSS classes to the link.

Usage & Scenarios

Extends the built-in LinkButton control to allow applying Bootstrap CSS classes to the button and sizes.

https://getbootstrap.com/docs/4.3/components/buttons/

Sample 1: Button Sizing

Use the Size property to set the size of the button.

<bs:LinkButton Click="{command: DoSomething()}" 
               Text="Button" />

<bs:LinkButton Click="{command: DoSomething()}" 
               Text="Button" 
               Size="Large" />

<bs:LinkButton Click="{command: DoSomething()}" 
               Text="Button" 
               Size="Small" />
public class ViewModel : DotvvmViewModelBase
{

    public void DoSomething()
    {
    }
}

Sample 2: Button Types

The Type property specifies the color of the button (using standard Bootstrap classes).

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Primary"
               Type="Primary" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Secondary"
               Type="Secondary" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Success"
               Type="Success" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Danger"
               Type="Danger" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Warning"
               Type="Warning" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Info"
               Type="Info" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Light"
               Type="Light" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Dark"
               Type="Dark" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Link"
               Type="Link" />
public class ViewModel : DotvvmViewModelBase
{

    public void DoSomething()
    {
    }
}

Sample 3: Button VisualStyle

The VisualStyle property allows to switch between buttons with solid fill and outline buttons.

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Solid Fill"
               Type="Primary"
               VisualStyle="SolidFill" />

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Outline"
               Type="Primary"
               VisualStyle="Outline" />
public class ViewModel : DotvvmViewModelBase
{

    public void DoSomething()
    {
    }
}

Sample 4: Block Buttons

To make the button behave like a block element, use the IsBlockButton property.

<bs:LinkButton Click="{command: DoSomething()}"
               Text="Solid Fill"
               Type="Primary"
               IsBlockButton="true" />
public class ViewModel : DotvvmViewModelBase
{

    public void DoSomething()
    {
    }
}

Properties

Name Type Description Notes Default Value
property icon Enabled Boolean Gets or sets a value indicating whether the button is enabled and can be clicked on.
attribute
inner element
static value
bindable
default
True
property icon IsBlockButton Boolean Gets or sets whether the button should be styled as a block element.
attribute
inner element
static value
bindable
default
False
property icon Size Size Gets or sets the size of the button.
attribute
inner element
static value
bindable
default
Default
property icon Text String Gets or sets the text on the button.
attribute
inner element
static value
bindable
default
property icon Type BootstrapButtonColor Gets or sets the color of the button.
attribute
inner element
static value
bindable
default
Primary
property icon VisualStyle ButtonVisualStyle Gets or sets whether the button has solid fill, or whether it is only an outline.
attribute
inner element
static value
bindable
default
SolidFill

Events

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

HTML produced by the control