tags:

views:

1037

answers:

5

I am creating some custom controls in WPF and need to therefore create the default control templates for them. To help in this process I would like to see the XAML of the control templates for the builtin controls as a reference.

I can open up the PresentationFramework.Class dll into .NET Reflector but cannot find anything inside it of use. It seems to have only BAML but not the original XAML.

Is this available online somewhere? Or is there a tool that can extract it?

+2  A: 

Check out StyleSnooper. It allows you to pick any of the inbuilt controls and dump out the default style xaml.

(You can also do this from Expression Blend if you have it.)

Simon P Stevens
Snoop can also do this - very lightweight, easy to use and has a few other features such as 3D zooming and heirarchy views:http://blois.us/Snoop/
Daniel May
+3  A: 

The BAML to XAML Viewer add-in for Reflector can extract the BAML, convert it to XAML and you can also save it to file.

Daniel May
+7  A: 

If you have Expression Blend installed several themes, including classic.xaml, can be found in

C:\Program Files\Microsoft Expression\Blend 3\SystemThemes\Wpf

ChrisF
If you have the Windows SDK installed they are also available in C:\Program Files\Microsoft SDKs\Windows\v6.1\Samples\WPFSamples.zip in the Core folder e.g. Core\ClassicTheme\xaml\classic.xaml
Phil Devaney
You can download these files directly from MSDN, without Blend: http://msdn.microsoft.com/en-us/library/aa358533.aspx
emddudley
+6  A: 

If you need to build new templates the sample control templates at http://msdn.microsoft.com/en-us/library/aa970773.aspx are often a better starting point.

The actual themes included with WPF are not designed to be extendable or understandable

Nir
Thank you for the link, I was going crazy with the built-in template source!
gmagana
+1  A: 

at http://www.xamltemplates.net/sample/sample.zip you can find a theme sample and you have the xaml files, check it out