Xaml Decompiler from Lutz Roeder

Lutz Roeder, author of the popular .NET class browser and decompiler reflector has released a Xaml disassembler. Xaml (used for defining UI layout and vector graphics in WPF applications) is typically "compiled" into a more efficient binary representation called Baml and embedded as a resource in WPF applications where it is read at run-time. Lutz' tool reverses this "compilation" process, returning Xaml which is much easier to understand than Baml, but also easier to copy. Lutz Roeder is a Microsoft employee has been a member of the Expression Blend (formerly Expression Interactive Designer, formerly Sparkle) team since 2002.

I performed some tests disassembling/decompiling non-trivial Baml from a few applications (some of which I had the source-code and some which I did not) and was impressed by the accuracy of the output. More details on using the BamlDecompiler utility can be found here. In addition to being able to disassemble Baml from WPF applications it is also useful for looking at the default control styles for the different windows themes. Although there are a number of classes in the System.Windows.Markup namespace (part of WPF and .NET3) that read Baml at run-time (for creating object instances) it seems that Lutz has had to do a fair bit of "heavy lifting" himself inside the BamlDecompiler class in which makes up the vast majority of the tool. No doubt this will become essential for analysing WPF code and 3rd-party libraries.