

<Window x:Class="Commanding.Window1"
    xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
    xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
    xmlns:m="clr-namespace:MyNamespace"
    Title="Commanding" Height="300" Width="300"
    >
  <StackPanel>

    <!-- Example 4-18. Invoking a command with a Button -->
    <Button Command="Copy">Copy</Button>
    <!-- End of Example 4-18. -->

    <!-- Example 4-19. Using a custom command in XAML -->

    <Button Command="m:MyAppCommands.AddToBasketCommand">Add to Basket</Button>

    <!-- End of Example 4-19. -->

    <Menu>
      <MenuItem Header="Example 4-21">
        
        <!-- Example 4-21. Passing a command parameter -->

        <MenuItem Command="m:MyAppCommands.AddToBasketCommand"
            CommandParameter="productId4823"
            Header="Add to basket" />

        <!-- End of Example 4-21. -->

      </MenuItem>

    </Menu>

  </StackPanel>
</Window>
