I've setup a custom command with PageDown as the key gesture, but for the MenuItem that is bound to that command the gesture shows up as "Next". The problem is that I have commands that use PageUp, Home, and End for related tasks and they all show up as expected for their MenuItems. Is there some way to make the MenuItem show "PageDown" instead of "Next" for consistency?
Here's the xaml that defines the commands.
<Window.Resources>
<RoutedUICommand x:Key="FirstPageCommand"
Text="FirstPage">
<RoutedUICommand.InputGestures>
<KeyGesture>Home</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="LastPageCommand"
Text="LastPage">
<RoutedUICommand.InputGestures>
<KeyGesture>End</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="PreviousPageCommand"
Text="PreviousPage">
<RoutedUICommand.InputGestures>
<KeyGesture>PageUp</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>
<RoutedUICommand x:Key="NextPageCommand"
Text="NextPage">
<RoutedUICommand.InputGestures>
<KeyGesture>PageDown</KeyGesture>
</RoutedUICommand.InputGestures>
</RoutedUICommand>
</Window.Resources>
And here is where I use them in a Menu
<MenuItem Header="_View">
<MenuItem Header="_First Page"
Command="{StaticResource FirstPageCommand}">
<MenuItem.Icon>
<Image Source="Images\Backward_01.png"
Stretch="Uniform"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Previous Page"
Command="{StaticResource PreviousPageCommand}">
<MenuItem.Icon>
<Image Source="Images\Backward.png"
Stretch="Uniform"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Next Page"
Command="{StaticResource NextPageCommand}">
<MenuItem.Icon>
<Image Source="Images\Forward.png"
Stretch="Uniform"/>
</MenuItem.Icon>
</MenuItem>
<MenuItem Header="_Last Page"
Command="{StaticResource LastPageCommand}">
<MenuItem.Icon>
<Image Source="Images\Forward_01.png"
Stretch="Uniform"/>
</MenuItem.Icon>
</MenuItem>
</MenuItem>
My menu looks like this
- View
- First Page Home
- Last Page PageUp
- Next Page Next
- Last Page End