Application Command List
Basically copied this from the link:
https://msdn.microsoft.com/en-us/library/system.windows.input.applicationcommands.aspx
Name |
Description |
Gets the value that represents the Browse Back command. |
|
Gets the value that represents the Browse Forward command. |
|
Gets the value that represents the Browse Home command. |
|
Gets the value that represents the Browse Stop command. |
|
Gets the value that represents the Decrease Zoom command. |
|
Gets the value that represents the Favorites command. |
|
Gets the value that represents the First Page command. |
|
Gets the value that represents the Go To Page command. |
|
Gets the value that represents the Increase Zoom command. |
|
Gets the value that represents the Last Page command. |
|
Gets the value that represents the Navigate Journal command. |
|
Gets the value that represents the Next Page command. |
|
Gets the value that represents the Previous Page command. |
|
Gets the value that represents the Refresh command. |
|
Gets the value that represents the Search command. |
|
Gets the value that represents the Zoom command. |
Here is my Aluminum Hat buddy to show you how to use these, scroll down below to see the code!
Working XAML Example of using the application commands, some of the application commands require that you use Command Bindings:
You can simply cut and paste all of the code into a WPF Application:
<Window x:Class="CommandBindings.MainWindow"
xmlns="https://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="https://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Window.CommandBindings>
<CommandBinding Command="Help" CanExecute="CommandBinding_CanExecute" Executed="CommandBinding_Executed"/>
</Window.CommandBindings>
<Grid>
<Menu VerticalAlignment="Bottom">
<MenuItem Header="Cut" Command="Cut" CommandTarget="{Binding ElementName=txtBox1}"/>
<MenuItem Header="Copy" Command="Copy" CommandTarget="{Binding ElementName=txtBox1}"/>
<MenuItem Header="Paste" Command="Paste" CommandTarget="{Binding ElementName=txtBox1}"/>
<MenuItem Header="Help" Command="Help"/>
</Menu>
<TextBox Height="23" HorizontalAlignment="Left" Margin="10,10,0,0" Name="txtBox1" VerticalAlignment="Top" Width="422" />
</Grid>
</Window>
The code behind that works with the CommandBinding shown above:
using System.Windows;
using System.Windows.Input;
namespace CommandBindings
{
public partial class MainWindow : Window
{
public MainWindow()
{
InitializeComponent();
}
private void CommandBinding_CanExecute(object sender, CanExecuteRoutedEventArgs e)
{
if (txtBox1!=null && txtBox1.Text.Length>3)
{
e.CanExecute = true;
}
}
private void CommandBinding_Executed(object sender, ExecutedRoutedEventArgs e)
{
MessageBox.Show("ARE YOU HELPLESS");
}
}
}