Where to find Generic.xaml for native WPF controls?

半世苍凉 提交于 2019-12-22 05:54:12

问题


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:

  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.




回答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

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!