It’s been three or four days of wierd, difficult to diagnose problems with Silverlight and topics related to it. The latest one involved Microsoft’s free Silverlight hosting service at Silverlight Live Streaming. It’s damned nice of MS to offer Silverlight developers up to 10 free gigs of storage and streaming support. In my case I have a Linux server on Network Solutions, which I could use to deploy my Silverlight work, however to do so requires modifying the mime types the server supports. I don’t have that level of access, so SLS was just the ticket. Or so I thought about three hours ago when I started trying to deploy and link to it.
As it turned out I had written the kind of application that doesn’t play well on SLS: one that expects to fill the browser window and follow size changes on the client. The way SLS works is that you upload the application’s XAP file to the server, and then either use an embedded iframe to invoke it, or controls that generate an embedded iframe. Either way you get an iframe. I know. An iframe. Whatever. The problem is that I needed my iframe to respect width:100% and height:100%… and that has long been a problem with iframes. They’re fine with the width mandate, but ignore the height. If you have an app with a fixed size you can simply configure that size in the SLS application configuration panel, and all is well.
But in order to solve the problem for a full-browser application I had to provide some javascript in the page that resizes the iframe’s height style attribute dynamically. If you’re interested in this solution, you can read about it in detail on the Silverlight.net forums.