Hi,
I have a usercontrol with a button inside that has a shortcut to the <PageDown> key through a command binding.
The purpose is that when the user hits the Pagedown Key, the program shows the next page.
This usercontrol is located on two ribbonbar tabs. When I now hit the Pagedown, Not the next page but the page behind it is shown (2 pages further). That means that when I hit the pagedown, the Event is raised two times, instead of 1. What could I do to prevent that from happening?? The command is shared, so should be used once.
I have a usercontrol with a button inside that has a shortcut to the <PageDown> key through a command binding.
The purpose is that when the user hits the Pagedown Key, the program shows the next page.
This usercontrol is located on two ribbonbar tabs. When I now hit the Pagedown, Not the next page but the page behind it is shown (2 pages further). That means that when I hit the pagedown, the Event is raised two times, instead of 1. What could I do to prevent that from happening?? The command is shared, so should be used once.
Private Shared MyViewNextPageButton As RibbonCommand = Nothing
Public Shared ReadOnly Property ViewNextPageButton() As RoutedCommand
Get
On Error Resume Next
If IsNothing(MyViewNextPageButton) Then
MyViewNextPageButton = New RibbonCommand("ViewNextPageButton", GetType(Ribbon), "Go to Next Page", Nothing, Nothing, "", New InputGestureCollection(New KeyGesture() {New KeyGesture(Key.PageDown, ModifierKeys.None, "Page Down")}))
End If
Return MyViewNextPageButton
End Get
End Property
<UserControl x:Class="RibbonPageElement"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:commands="clr-namespace:Applications.Designer"
xmlns:ribbon="http://schemas.actiprosoftware.com/winfx/xaml/ribbon">
<Grid>
<ribbon:Button Name="PageView_NextPage" HorizontalContentAlignment="Center" Width="30" Command="commands:PADSDesignerCommands.ViewNextPageButton" ></ribbon:Button>
</Grid>
</UserControl>
Ribbonbar:
<ribbon:Group Label="Next Page">
<local:RibbonPageElement x:Name="HomeRibbonPageElement"></local:RibbonPageElement>
</ribbon:Group>