Question

As per this MSDN link,

There is no way to replace only part of the visual tree of a control; to change the visual tree of a control you must set the Template property of the control to its new and complete ControlTemplate

.

I am trying to disable the click behaviour of GridViewColumnHeader ( I need to remove some triggers in the original control template), but i am not able to find the native "ColumnHeaderContainerStyle". All those i have found seem to have already done some customization and it is being difficult to get the original look and feel.

Can someone please suggest me how/where can i get the original control templates as defined in the native WPF controls?

Thanks for your interest.

Was it helpful?

Solution

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.

OTHER TIPS

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
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top