Set Command for Button on a ToolBar : ToolBar « Windows Presentation Foundation « VB.Net






Set Command for Button on a ToolBar

Set Command for Button on a ToolBar
       
<Page xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
      xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml">
<DockPanel>
  <Menu DockPanel.Dock="Top">
    <MenuItem Header="_Edit">
      <MenuItem Header="Cu_t"   Command="ApplicationCommands.Cut" />
      <MenuItem Header="_Copy"  Command="ApplicationCommands.Copy" />
      <MenuItem Header="_Paste" Command="ApplicationCommands.Paste" />
    </MenuItem>
  </Menu>
  <ToolBarTray DockPanel.Dock="Top">
    <ToolBar>
      <Button Command="Cut" Content="Cut" />
      <Button Command="Copy" Content="Copy" />
      <Button Command="Paste" Content="Paste" />
    </ToolBar>
  </ToolBarTray>
  <TextBox />
</DockPanel>
</Page>

   
    
    
    
    
    
    
  








Related examples in the same category

1.Using Separator with ToolBarUsing Separator with ToolBar
2.ToolBar with OverflowMode, Never, AsNeeded, AlwaysToolBar with OverflowMode, Never, AsNeeded, Always
3.ToolBar and event handlerToolBar and event handler