How to get a refernce of Clipboard

I am copying Object from one canvas and trying pasting it to another canvas, how do we get the reference of data in the clipboard(copied object).

We have derived a class from CommandHandler and overrides a Paste Method and in this method before pasting object to the canvas how do we get its reference of clipboard (buffer), I mean the property which gets this Object reference
1 Like

Is this in WPF or in Silverlight?

In WPF you can use the Clipboard class to access it at any time.

In either GoWPF or GoSilverlight you could override the CommandHandler.CopyToClipboard and PasteFromClipboard methods.

Thanks for your help

But this does not resolved my problem. I am working on Silverlight 4.
I need a Property which gets Set when we try pasting an Object( in the ClipBoard) on a canvas, in override Method of Paste of class CommandHandler. So that I can decide whether this Object needs to be pasted over the canvas or not. I can setup a condtional based pasting by early recognising the Object before pasting it to the canvas.

One possibility is to override CommandHandler.CanPaste().
You can call PasteFromClipboard() to look at the data in the clipboard.

Or you can implement a Diagram.ClipboardPasted event handler and consider deleting the Diagram.SelectedParts.