tags:

views:

316

answers:

2

Where to find Generic.xaml (or other code with the default look) for native WPF controls such as Button, CheckBox, TextBox, etc?

A: 

Unfortunately the XAML for native controls is not directly available as a file. You need to use a program for peeking into the WPF assemblies and extracting that info. I personally have used the Mole for Visual Studio tool, which has done the job very well. It integrates as a debugger-visualiser, which is quite handy.

Noldorin
@Noldorin: I can see the style of a control if I implemented the style myself. But how do I get the default style for native controls? Mole doesn't show me that, I don't think. Please let me know if I am wrong. Thanks!!!
Gustavo Cavalcanti
Mole is *designed* for showing you the styles of built-in (native) controls. The instructions should say all. What's the exact issue you're having?
Noldorin
+2  A: 

In Silverlight (and I know that your question is about WPF) this information is more accessible than in WPF. You can get this information from any of these sources:

  1. Control Styles and Templates on MSDN.

  2. You can look at the resources of the relevant Silverlight assembly and extract the themes/generic.xaml embedded in a resource. I use Reflector to do this.

  3. You can extract the control template of a specific control using a tool. I use Expression Blend to do this. This also works for WPF.

Martin Liversage