I would like to find a way to see what happens during the loading of my XAML. What classes are created, and in what order? What properties are set, what values and in what order? What methods are called (for example, BeginInit, EndInit, etc.), in what order and with what parameters? That kind of thing.
(If anyone is wondering why, because the XAML loader does something magical, that I cannot duplicate the code , and I'm trying to figure out what it is.)
Does anyone have any other ideas on how I could get specific information about what the XAML loader does? Are there any tools (profiler, maybe?) That could give me a call schedule? Is there a way to enable some kind of log in the XAML bootloader? Thoughts / suggestions?
Edit: The article related to this has an answer, although their sample code makes each event appear twice. For reference, here's how to make this work in code (no changes to app.config are required). Add these lines before calling InitializeComponent () (or enter both lines in the Immediate window in the debugger):
PresentationTraceSources.Refresh();
PresentationTraceSources.MarkupSource.Switch.Level = SourceLevels.All;
This will cause verbose output to appear in the VS output window, including properties that are magically configured behind the scenes.