#724 – Sample Code for Examining Control Templates
January 1, 2013 Leave a comment
Charles Petzold, in his book Applications = Code + Markup, includes lots of useful sample code. In chapter 25, talking about templates, he presents source code for a DumpControlTemplate project. You can find the source code at http://www.microsoft.com/mspress/companion/0-7356-1957-3/. Download the code samples and then look for the DumpControlTemplate project under chapter 25.
You start by selecting a control from the Control menu.
Once you select a control, the application will render the control in the top half of the window. You can then select the template that you want to see from the Dump menu. For example, we can choose to see the control template for a Button.
After you select the desired template, the XAML for that template is displayed in the main window.
(Note that you can select text in this window, right-click and select Copy).