I am working with the clipboard in .net with the following code
List<object> templateList = new List<object>();
Clipboard.Clear();
Clipboard.SetDataObject(templateList);
IDataObject dataObject = Clipboard.GetDataObject();
var x = (List<object>)dataObject.GetData(typeof(List<object>));
For the above code x is an empty List of objects as you would expect
if i change the code to be
List<Template> templateList = new List<Template>();
Clipboard.Clear();
Clipboard.SetDataObject(templateList);
IDataObject dataObject = Clipboard.GetDataObject();
var x = (List<Template>)dataObject.GetData(typeof(List<Template>));
x is now null
the class for Template is both public and Serializable and the application is running on a STAthread
Any ideas?