Question on GData forums about Silverlight
That was the question asked on Feb 6, 2008 on GData forums.
I have blogged about it in my Silverlight Blog (that is being deprecated, as I aggregate my disparate blogs back into one)
Here is my post, relevant to about 2 month ago.
I am using Silverlight Alpha 1.1 with Google Spreadsheets. You can check it out at
www.gganttic.com
It is a Gantt chart based project management that stores tasks in Google Spreadsheets. The Gantt control is SL 1.1 based.
SL currently does not work cross domain. I hit this limitation several months back.
So I started using GData .NET client library on the server end to proxy.
it was said (don't remember where) that SL 1.1 when released (it is going to be released as SL 2.0) will do cross-domain.
I did not want to wait for it. So here is the better way.
It is to do the communication in JavaScript layer, above SL.
SL is good in communicating between control and outside DOM environment.
So SL can throw an event, that is wired to a GData function, this function calls asynchronously a server (which can be any domain)
receives JSON data, calls into SL control via SL scriptable methods.
Scriptable are methods of SL that are marked so (if you are C#, it is [Scriptable] attribute on top of a method)
There is one drawback to it, the parsing logic would have to be in JS.
So for the time being I am doing it still with my server. There is a lot of guesswork involved in trying to understand which column of spreadsheet means what metadata of a task - so it is best done in C#.
A word of warning. Just like Frank (the guy on GData team) suspected, SL has a tiny subset of .NET framework. So GData .NET library would not even compile - it would need core classes SL has not gotten. It makes sense - SL is only 4.5 M download so Microsoft had to cut on everything.
I initially hoped I could use Netika control. Netika guys did a great work adding virtually all of Windows.Forms classes to SL.
It did not work. First Netika control is 900K, too much for my taste, and second it did not compile anyway. Incomplete implementation.
So the bottom line:
- In the future you'll be able to call GData feeds direct from SL, but you'll have to modify .NET library or write your own parser for the feeds.
- there is a good way of communicating cross domain using JavaScript library. GData has got JS lib for Calendar and Blogger, if I am not mistaken.
No comments:
Post a Comment