PasteFromClipboardAction.CanExecute return true but PasteFromClipboardAction.Execute does nothing

SyntaxEditor for WPF Forum

Posted 5 years ago by Jianjun Wang
Version: 15.1.0624

When the data in clipboard is something (like image) other than text, the PasteFromClipboardAction.CanExecute() return true to say paste is enabled but PasteFromClipboardAction.Execute() does nothing if the clipboard data is not text.

Is this a designed behavior? Will it be better that the PasteFromClipboardAction.CanExecute() and PasteFromClipboardAction.Execute() use the consistent condition check so that if PasteFromClipboardAction.Execute() does nothing, then PasteFromClipboardAction.CanExecute() should return false.

Comments (1)

Posted 5 years ago by Actipro Software Support - Cleveland, OH, USA


The PasteFromClipboardAction currently returns true from its CanExecute() if the document isn't read-only.  The reason we don't check the clipboard is that checking the clipboard is a relatively "expensive" operation in terms of cycles and the use of routed commands would require that we do the check each time text is typed, something is clicked, or focus moves around.  We don't want to hamper down application performance with constant checks.

Actipro Software Support

The latest build of this product (v2020.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.