Friday, December 04, 2009

Can't you feel the Moonlight? Part deux

As I was saying yesterday, the live version of the silverlight toolkit site didn't work right in moonlight. All the pretty charts rendered as you see them below, very empty.

I figured that since a slightly older version worked near-flawlessly, surely I could fix the live version with only a few minor tweaks. It's not like the would've completely rewritten the Chart controls within the space of 1 release.

I checked everything from DataBinding, to TemplateBinding, to Styles, to Measure/Arrange bugs and nothing was showing up as causing the issue. I finally narrowed it down to a bug in VisualStateGroup. For some reason the Name property was empty even though it was declared with a name in xaml.

One. Tiny. Patch. Later.


Success. I can't believe that the bug was that simple. In the end, those bugs are actually by far the worst. There's no exception thrown or any kind of visible indication that something has failed other than an empty screen. The only reason I found the bug was because the toolkit is opensource and I was running it locally with a few dozen Console.WriteLines, gradually reducing the area of code where I thought the bug was. Unfortunately this fix arrived too late for the 1.99.9 release, but it will definitely be in the release after it.

3 comments:

Anonymous said...

How come this is part of a Moonlight sourcecode:

"Copyright (c) Microsoft Corporation. All Rights Reserved."

?

Anonymous said...

Forgot, nice work btw :)

Alan said...

Before the official Silverlight 2.0 release, a moderate amount of source for certain controls in Silverlight were released under an open source license. We imported those files to our repository and based our re-implementation on those files. This fix is just one of many which have been applied to those source files. Some of them, like ItemsControl, ListBox, ComboBox have been nearly completely rewritten. Others are still 95%+ original code.

Hit Counter