Cut ,copy , paste operations


I have multiple instances of goxam diagram on my screen. Now my requirement is, I have some cut ,copy & paste icons. These operation are working for only one diagram. How I can achieve the functionality if I have copied one object from one diagram and want to paste in another one. Please suggest.

The diagrams all need to use exactly the same kind of model, and the model data (to be specific, an IDataCollection and its data) needs to be copyable.

In WPF model data that is copied to the clipboard (by CommandHandler.CopyToClipboard) is serialized. So you’ll need to make sure that all of your data is serializable.

In Silverlight and in WPF the data will also need to be copied. If your data is ICloneable, the model is able to copy it. If implementing ICloneable is inconvenient or impossible, you can override the Copy… methods of the model.

Thanks .To be more specific with my previous post, I am using silverlight. cut,Copy & paste operations are working with standard key strokes within multiple diagram. I tried copy command where I need to pass the diagram name. So it is working only for perticular diagram and not across the diagrams

Please suggest how to implement the copy command. If possible share the code sample

That should just work, if the models are of exactly the same type and if the data is copyable.

Wait: are you trying to copy across AppDomains? For example, are the diagrams in separate Silverlight apps? If so, sorry, but I think Silverlight does not support that. Or at least I don’t remember one off-hand. Maybe Silverlight 4 provides something I’ve forgotten about. I suppose you could implement an alternative communications mechanism, say via your web server, but that would be very application-specific.