问题
Where to find Generic.xaml (or other code with the default look) for native WPF controls such as Button, CheckBox, TextBox, etc?
回答1:
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:
Control Styles and Templates on MSDN.
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.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.
回答2:
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.
来源:https://stackoverflow.com/questions/1662647/where-to-find-generic-xaml-for-native-wpf-controls