Silverlight 2.0 Cross Domain Calls

I was just reading Scott Guthries blog post about silverlight 2.0 and I came across a section discussing how Silverlight will be able to do cross domain calls. I have been very curious how they were planning on solving this one without risking the security of silverlight.

It turns out that all you need on the remote domain is an XML policy file that will allow applications to call your domain directly. It seems that this is how flash has been doing it for a while now and silverlight 2.0 will also respect flash policy files.

Flash vs. Silverlight, Indeed

I was just looking at indeed.com and decided to put in Flash vs. Silverlight. The results are pretty interesting:

At the time of this posting flash goes from 0% in May ’05 to about 100% in Sept ’07 while silverlight has gone from 0 at May ’07 to 1,300% in Oct. ’07. I guess we can see that Microsoft has done a good job of getting people excited about Silverlight. Now all they need to do is devliver the goods.

Also, one other interesting thing is how F# creates a graph that sort of looks like the New York skyline:

That seems pretty ironic from a functional language.

Simple Silverlight Image Gallery

    So, here is a simple example of how to do a data driven image gallery using silverlight. The overview is that an image will be stretched across a Rectangle to display our images. Our image gallery control will call back to a webservice hosted by our webserver to get URLs to subsequent images in the gallery. This is a pretty basic example and could easily be extended to have more interesting logic for getting images (flickr maybe or an image in a sharepoint image gallery for example) since we’re simply using the raw URL to the image to display it.
 
    To get all of this working you will need to be sure you have the asp.net futures stuff installed and you create an asp ajax futures project for your website. Then you create your silverlight project and create a “link” back to the silverlight project. For those of you not in the know this is a new thing Microsoft cooked up special for Silverlight. It’s similar to a reference but it pulls in the assemblies to the ClientBin rather than the Bin as well as pulling in the Page.xaml necessary to get it going with IIS. You’ll need to either use javascript or an tag to get it working.
 
    On the client side we have an HtmlTimer class to tell us when it is time to get a new picture. During initialization we will get a list of all of the images (you could just as easily query the service for only the next image) using the standard web service proxy class created by adding a webreference in our silverlight probject. On the Tick handler we will use the URL to the image to fill the rectangle.