Where can i find the default WPF Control templates?

冷暖自知 提交于 2019-11-28 20:10:01
gehho

You can find the templates for all themes here at MSDN.

(The link should take you directly to the correct location on the page. After the whole page is loaded (might take some seconds), the "Themes" section should be at the top of your browser's content.)

EDIT: It seems like the link above does not work any longer. Please refer to the link given in the post by McGarnagle.

Furthermore, there are several tools out there which can read the styles from an assembly. For example, you could use Style Snooper. However, for your scenario (getting the built-in templates), the above MSDN link should be the easiest.

In Visual Studio 2015 (at least) you can right click the control in the XAML designer and select "Edit Style->Edit a Copy" to view and edit the default template for a control. Much easier than cracking open Blend, downloading a style viewer, or searching the web.

I arrived at this question via Google a few times, and could not see the link I wanted, so here it is...


These links have the following info for each framework control:

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