#724 – Sample Code for Examining Control Templates

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.

724-001

 

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.

724-002

 

After you select the desired template, the XAML for that template is displayed in the main window.

724-003

 

(Note that you can select text in this window, right-click and select Copy).

About these ads

About Sean
Software developer in the Twin Cities area, passionate about .NET technologies. Equally passionate about my own personal projects related to family history and preservation of family stories and photos.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Follow

Get every new post delivered to your Inbox.

Join 381 other followers

%d bloggers like this: