Are you getting any error/warning messages during this function? I’m wondering if your data has any serialization issues. Oh, and is this WPF or Silverlight?
Why can’t you just call myDiagram.CommandHandler.Copy()?
This is WPF… No errors during the Copy, but I am getting an error during Paste:
System.OutOfMemoryException: Insufficient memory to continue the execution of the program.
at System.Runtime.InteropServices.ComTypes.IDataObject.GetData(FORMATETC& format, STGMEDIUM& medium)
at System.Windows.DataObject.OleConverter.GetDataInner(FORMATETC& formatetc, STGMEDIUM& medium)
at System.Windows.DataObject.OleConverter.GetDataFromOleHGLOBAL(String format, DVASPECT aspect, Int32 index)
at System.Windows.DataObject.OleConverter.GetDataFromBoundOleDataObject(String format, DVASPECT aspect, Int32 index)
at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert, DVASPECT aspect, Int32 index)
at System.Windows.DataObject.OleConverter.GetData(String format, Boolean autoConvert)
at System.Windows.DataObject.GetData(String format, Boolean autoConvert)
at System.Windows.Clipboard.GetDataInternal(String format)
at System.Windows.Clipboard.GetData(String format)
at Northwoods.GoXam.CommandHandler.PasteFromClipboard()
at Northwoods.GoXam.CommandHandler.Paste()
And I’m not using the regular Copy as that calls Clone for each object data class, but I’ve added another method CopyWithData that I would like to use for this copy. We are still using Copy & Clone, but with those we are clearing out values of the addition properties we’ve added to the class, with this new method we would like to retain the values of all of the properties.