We have an application in which we would like to support a custom clipboard format for copying\pasting in a RadRichTextBox. I have read your article on clipboard support (http://docs.telerik.com/devtools/wpf/controls/radrichtextbox/features/clipboard-support), but that seems to mainly deal with changing which provided clipboard formats are used.
It appears that if I register a custom format provider with ClipboardEx, that would be able to handle pasting the custom format. For example:
ClipboardEx.ClipboardHandlers.Insert(0,
new
ClipboardHandler()
{
ClipboardDataFormat =
"MyCustomDataFormat"
,
DocumentFormatProvider =
new
MyCustomFormatProvider()
});
However, I don't see a way to handle copying a custom format without intercepting the CopyExecutingCommand and adding the custom format the the clipboard. For example:
void
RadRichTextBox_CommandExecuting(
object
sender, CommandExecutingEventArgs e)
{
if
(e.Command
is
CopyCommand)
{
Clipboard.SetData(
"MyCustomDataFormat"
, GetSelectionAsCustomDataFormatString());
}
}
However, I would want to make sure that the default clipboard formats are still added to the clipboard in addition to our custom format.
Can you provide any guidance on the best way to handle copying and pasting a custom clipboard format?
Thank you.