Not sure if this is possible, but if I have a template object (passed in to the OnApplyTemplate override) is there any way I can examine the string-representation of the XAML that makes it up? I know internally when the template's XAML gets compiled, it's actually converted to BAML, and I know by the time the code gets to the override, it's neither as it's already rehydrated into actual objects, which is why I'm asking.
Actually, if you can go from a template object to XAML, couldn't you then theoretically go from any WPF object to it's XAML representation? I'd settle for the former of just a template however.
This is C# in .NET 4.0, not Silverlight FWIW.
M