Permalink
Fetching contributors…
Cannot retrieve contributors at this time
66 lines (61 sloc) 2.41 KB
<!-- <SnippetCommandingOverviewWindowCommandBindingXAML> -->
<Window x:Class="SDKSamples.Window1"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:custom="clr-namespace:SDKSamples"
Height="600" Width="800"
>
<Window.CommandBindings>
<CommandBinding Command="{x:Static custom:Window1.CustomRoutedCommand}"
Executed="ExecutedCustomCommand"
CanExecute="CanExecuteCustomCommand" />
</Window.CommandBindings>
<!-- </SnippetCommandingOverviewWindowCommandBindingXAML> -->
<!--<SnippetCommandingOverviewXAMLKeyBinding>-->
<Window.InputBindings>
<KeyBinding Key="B"
Modifiers="Control"
Command="ApplicationCommands.Open" />
</Window.InputBindings>
<!--</SnippetCommandingOverviewXAMLKeyBinding>-->
<StackPanel Name="sp">
<!--<SnippetCommandingOverviewSimpleCommand>-->
<StackPanel>
<Menu>
<MenuItem Command="ApplicationCommands.Paste" />
</Menu>
<TextBox />
</StackPanel>
<!--</SnippetCommandingOverviewSimpleCommand>-->
<!--<SnippetCommandingOverviewCmdSourceXAML>-->
<StackPanel>
<StackPanel.ContextMenu>
<ContextMenu>
<MenuItem Command="ApplicationCommands.Properties" />
</ContextMenu>
</StackPanel.ContextMenu>
</StackPanel>
<!--</SnippetCommandingOverviewCmdSourceXAML>-->
<!-- <SnippetCommandingOverviewXAMLCommandTarget> -->
<StackPanel>
<Menu>
<MenuItem Command="ApplicationCommands.Paste"
CommandTarget="{Binding ElementName=mainTextBox}" />
</Menu>
<TextBox Name="mainTextBox"/>
</StackPanel>
<!-- </SnippetCommandingOverviewXAMLCommandTarget> -->
<!-- <SnippetCommandingOverviewCustomCommandSourceXAML> -->
<StackPanel>
<Button Command="{x:Static custom:Window1.CustomRoutedCommand}"
Content="CustomRoutedCommand"/>
</StackPanel>
<!-- </SnippetCommandingOverviewCustomCommandSourceXAML> -->
<Button Height="50" Click="AddCommand">Add Command</Button>
<Button Height="50" Click="RemoveCommand">Remove Command</Button>
<!-- <SnippetCommandingOverviewCmdManagerAddHandlersXAML> -->
<Button Command="ApplicationCommands.Help"
Name="helpButton">Help</Button>
<!-- </SnippetCommandingOverviewCmdManagerAddHandlersXAML> -->
</StackPanel>
</Window>