<h1>
    Menu Commands
</h1>
<p>
    The Menu control also supports MVVM-style commanding, which
    requires no event handlers at all.
</p>
<p>
    To use the Menu control with commands, set the Menu's
    <b>command</b> property to an object with two methods:
</p>
<ul>
    <li>
        <b>canExecuteCommand</b>: This method takes an argument that
        represents a parameter and returns a Boolean value indicating
        whether the command can be executed in the current application
        state.
    </li>
    <li>
        <b>executeCommand</b>: This method takes an argument that
        represents a parameter and executes the command.
    </li>
</ul>
<p>
    For example, the InputNumber below shows a tax value that
    can be edited directly or by using menu commands. Notice
    how some commands are automatically disabled depending
    on the current tax value:
</p>

<div class="demo-settings">
    <label for="currentTax">
        Current Tax
    </label>
    @Html.C1().InputNumber().Id("currentTax").Format("p2").Min(0).Max(1).Step(0.025).Value(0.0825)
    <br>
    <label for="changeTax">
        Change Tax
    </label>
    @(Html.C1().Menu().Id("changeTax")
        .Header("Tax Commands")
        .MenuItems(items =>
        {
            items.Add("Increment by 50%", 0.5);
            items.Add("Increment by 25%", 0.25);
            items.Add("Increment by 5%", 0.05);
            items.AddSeparator();
            items.Add("Decrement by 5%", -0.05);
            items.Add("Decrement by 25%", -0.25);
            items.Add("Decrement by 50%", -0.5);
        })
    )
</div>