Jonathon pointed out a flaw in my BAML article. I made it sound like downloading the latest version of Reflector was all you had to do. That’s not true, you also have to download another tool. I guess wasn’t too clear in explaining how Reflector creates XAML from BAML. Here is a more detailed roadmap.
Lutz Roeder has created a tool, BamlDisassembler (update on March 10,2007, new addin for Reflector 5.0 is available. BamlViewer )), that reads BAML from an assembly resource and converts it to XAML. You can run BamlDisassembler at a command prompt like so:
BamlDisassembler input.baml output.xaml
You can also run BamlDisassembler from Reflector. This is what I was trying to say in my previous article. Here’s how:
- In Windows, register the .baml file extension with BamlDisassembler.
- Run Reflector
- Open the WPF assembly in Reflector
- Click the resources folder in the WPF assembly
- Click the *.g.resources node
- Double click the *.baml file
- Enjoy reading the XAML