ApplicationCommand.Paste happens twice

Posted by Carlo on Stack Overflow See other posts from Stack Overflow or by Carlo
Published on 2010-05-13T21:52:39Z Indexed on 2010/05/13 21:54 UTC
Read the original article Hit count: 321

Filed under:
|

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.

Thanks!

© Stack Overflow or respective owner

Related posts about wpf

Related posts about commandbinding