Hi, well this is driving me crazy. We have a command like so:
<CommandBinding Command="ApplicationCommands.Paste" CanExecute="HasClipboardData" Executed="OnPasteExecuted"/>
And the code for OnPasteExecuted is this:
private void OnPasteExecuted(object sender, ExecutedRoutedEventArgs e)
{
CurrentView.Paste();
e.Handled = true;
}
That code gets executed twice, and I have no idea why, we also have the other commands: Cut, Copy, Undo, Redo, those work just fine, the problem is only with Paste. Let me know if you have any idea of what could be going on.
Oh, btw, this only happens when we use the keyboard gesture "Ctrl + V", if we use the command through a button, it doesn't happen. And it's the very same command.
Thanks!
EDIT:
This is how one of the buttons is bound:
<igRibbon:ButtonTool Id="pasteTool" Command="ApplicationCommands.Paste" Caption="Paste" igRibbon:RibbonGroup.MaximumSize="ImageAndTextLarge"
SmallImage="Images/Ribbon/Copy16.png" LargeImage="Images/Ribbon/Copy32.png" />
And this is the context menu item:
<UserControl.ContextMenu>
<ContextMenu Opened="ContextMenu_Opened">
<MenuItem Command="ApplicationCommands.Paste"/>
</ContextMenu>
</UserControl.ContextMenu>