I have embedded a Silverlight class into my page, and in App.xaml.cs this component is registered to allow calls to Silverlight methods from JavaScript, which is functioning correctly.
However, I now want to access not just methods, but collections. For example, I have a public property:
[ScriptableMember]
ICollection<FileInfo> Files {get;set;}
During runtime, I checked the accessibility of the Files member:
silverlightPlugin.Content.Uploader.Files | {...} | Object
It is defined and has an object type.
Yet when I try to call any of the following:
silverlightPlugin.Content.Uploader.Files.Count
silverlightPlugin.Content.Uploader.Files.Count()
silverlightPlugin.Content.Uploader.Files.get_Count
silverlightPlugin.Content.Uploader.Files.get_Count()
I receive an exception saying "Input string was not in a correct format."
Is there a way to access collections from JavaScript, or do I need to implement a special method?