Silverlight 4 beta and my disappointment with the WebBrowser control

Silverlight 4 logo by Tim Heuer So as most of you probably know by now, Silverlight 4 has been announced and a beta is already released, you can head off over here to find out what’s new and to download the bits you need like Visual Studio 2010 Beta 2, etc. One big warning though, if you have the Silverlight 3 SDK installed on your machine, uninstall it before installing Visual Studio 2010 as it might barf the Visual Studio 2010 installation.

So one of the features I’ve been eagerly awaiting in Silverlight 4 is the new WebBrowser control. Yeah as strange as it may seem I want to embed some web content in a Silverlight control. Well not a control as such but more a Silverlight application. And I’ve managed to do it since Silverlight 2 by creating iframe elements in the underlying HTML DOM and absolutely positioning them over my Silverlight control, all from within the Silverlight application. This has however one major limitation – you can’t put Silverlight content on top of the HTML iframe unless its in a seperate object element which doesn’t exactly suit my needs.

Silverlight 4 WebBrowser doesn't play niceAnd it turns out that the Silverlight 4 beta WebBrowser control suffers the same horrible fate, as you can see in a screenshot of a quick test application on the left. Except it has another awkwardness to it – it has to be run out of the browser as well. Looks like I’ll be sticking to my iframe approach for in the browser and consider using the WebBrowser control for out of the browser only.

Now don’t get me wrong, I do like the new control, but I would like it to be even better. If anyone on the Silverlight team reads this, please make the WebBrowser control a proper Silverlight control that can have pure Silverlight controls over it.

Silverlight 3 beta is available

Most of you knew it was coming and I’m really excited that its out now so I can talk about it. Silverlight 3 really is very cool and adds amazing performance improvements and additional features that people have been wanting.

My personal favourites are:

  • Hardware graphics acceleration – Our application just feels way more zippy than before.
  • Tighter XAP file compression – Everyone benefits from better ZIP compression ratios.
  • External styles – Now you can reference an external style. Great for skinning applications.
  • Out of browser/offline mode – Finally a competitor for the Adobe AIR platform.

If you are currently developing using Silverlight 2 I recommend that you install the new Silverlight 3 beta bits in a virtual machine. You can get them all from here.

Microsoft Silverlight 2 released

After many months of beta testing Microsoft Silverlight 2 it has been officially announced that it will release today, the 14th of October 2008.

A release build was expected to emerge sometime in November so it seems the team is very confident with the RC0 developer-only build that emerged recently. Unluckily for my team we just released our new product on Friday based on Silverlight 2 beta 2 under the Go-Live license thinking we had at least a month before Silverlight 2 released to fix up compatibility issues. Looks like this week is going to be a busy one for us.

Here is a snippet from the official press release:

Silverlight 2 will be available for download on Tuesday, Oct. 14, at http://www.microsoft.com/silverlight. Customers already using a previous version of Silverlight will be automatically upgraded to Silverlight 2.

What is awesome though is that Microsoft will soon release an extra set of Open Source controls known as the Silverlight Control Pack including a DockPanel, ViewBox, TreeView, Accordion and AutoComplete control.

Silverlight 2 Beta 2 now available

Microsoft Silverlight Microsoft earlier this week announced at Tech-Ed North America 2008 that Microsoft Silverlight 2 beta 2 will be available for download this week.

The new Silverlight 2 beta 2 control updates the version number from 2.0.30226.2 to 2.0.30523.6. This release is expected to break compatibility with Silverlight 2 beta 1 while improving compatibility with Silverlight 1. For a full list of changes and new features, take a look here.

Please note, that you should uninstall all previous Silverlight 2 beta 1 bits before you attempt to install the new beta bits. The Silverlight 2 beta 2 control seems to upgrade seamlessly enough though. A list of stuff that should be removed includes:

  • Microsoft Expression Blend 2.5 March Preview
  • Microsoft Silverlight Tools Beta 1 for Visual Studio 2008
  • Microsoft Silverlight 2.0 SDK Beta1

Also note that the Microsoft Silverlight Tools Beta 2 for Visual Studio 2008 will install fine on top of Visual Studio 2008 RTM or Visual Studio 2008 Service Pack 1 Beta.

Well they were really cutting the before the end of the week promise close but you can now get hold of the latest beta developer bits using the following links:

If you aren’t using Visual Studio 2008 then you can download the SDK on its own using the following link:

I’ve also noticed another build of the Silverlight 2 beta 2 control that is targeted for developers. I assume it has more debugging support as its slightly larger in size. I don’t think its included in the Microsoft Silverlight Tools Beta 2 for Visual Studio 2008 installer.

And if you liked the Deep Zoom technology that was first shown in Silverlight 2 beta 1 then get yourself an updated set of tools to work with Silverlight 2 beta 2:

I personally can’t wait to get started with this new build as it now finally carries a commercial Go Live license.

Take a look at the following post which goes into details about the new features in the Silverlight Tools for Visual Studio 2008.

  1. WCF templates for Silverlight Enabled.
  2. Build configurations.
  3. XAML Validation now reports build errors.
  4. Setup Improvements.
  5. Projects created in Beta 1 are prompted for conversion when opening to Beta 2
  6. Linking a Web Site to a Silverlight Application.

[tags]Silverlight,Silverlight 2,Tech-Ed[/tags]

Silverlight Streaming plug-in for Expression Encoder

For those of you that were at Tech-Ed or at his SA Developer talk, Angus Logan demonstrated publishing Silverlight content directly into the Silverlight Streaming service cloud from inside Microsoft Expression Encoder. He has just announced that a new preview version of the plug-in is available for download along with an introduction video on how to get started.

So why not take advantage of the 4GB of free storage and the worldwide content delivery network provided by the Silverlight Streaming by Windows Live. There is even a cool plug-in for Windows Live Writer to make publishing of Silverlight videos a piece of cake in blog posts. The best part is that because the video is hosted in the cloud, you won’t be running out of hosting bandwidth anytime soon.

I suggest following his blog post for instructions and download links.

[tags]Silverlight,Expression Encoder[/tags]

Halo 3 Game Guide and Silverlight

image I can’t figure out if this post is about Microsoft’s Flash killer, Silverlight, or the most anticipated game of the year, Halo 3. Tim Sneath posted about the new Halo 3 Game Guide that has gone live and its using Silverlight to get the message across.

With the local launch of Halo 3 this coming Wednesday, the 26th of September 2007, the Halo 3 Game Guide is a valuable resource for South African gamers that don’t know too much about what happened in the original Halo and Halo 2; not that I believe you need to know the story to enjoy the game.

The game guide also explains the game controls, heads-up display, characters, weapons, equipment, vehicles and explains how to use some of the very cool new features like The Forge.

The Forge is a new game mode that allows you to tweak, create, or even destroy the objects present on any multiplayer map. In short, welcome to world domination!

If you haven’t pre-ordered your copy for your Xbox 360 yet then I suggest you get hold of a retailer like BT Games or a major retailer and reserve your copy quickly as this game is going to be flying off the shelves this week.

[tags]Halo 3,Silverlight,guide[/tags]

Silverlight 1.1 UserControl C# template code does not follow best practices

Why does the Microsoft Visual Studio team not follow the best practices internally? When creating a Silverlight 1.1 UserControl under Visual Studio 2008 Beta 2 it generates the following code by default.

    System.IO.Stream s = this.GetType().Assembly.GetManifestResourceStream("Project1.UserControl1.xaml");
    this.InitializeFromXaml(new System.IO.StreamReader(s).ReadToEnd());

Most developers would realise that this is not good code. Why do I say this, well firstly the code is creating two objects, a System.IO.UnmanagedMemoryStream and a System.IO.StreamReader, that implement IDisposable and are not disposing the objects immediately after use. Yeah sure the finalizer will take care of any unmanaged resources at the end of the day but why not just release the resources in a predictable and up front manner. I have recommended that Microsoft use the following instead.

    using (System.IO.Stream s = this.GetType().Assembly.GetManifestResourceStream("Project1.UserControl1.xaml"))
    {
        using (System.IO.StreamReader sr = new System.IO.StreamReader(s))
        {
            this.InitializeFromXaml(sr.ReadToEnd());
        }
    }

If you feel strongly about best practices, please take a moment and vote for this on the feedback site here.

[tags]Visual Studio,Silverlight,best practices[/tags]