tags:

views:

41

answers:

1

Somewhere I read that ExpressionBlend can create copies of the default style of a wpf control for the developer to edit.
However, VisualStudio can not. (At least I haven't found a way...)

Is it possible to access/view the default styles (and templates) of wpf controls.

A Gui would be nice, but a (web)-resource to view the styles would also do.

+1  A: 

You can either use Style snooper or ShowMeTheTemplate to get the default styles for WPF controls.

You can also do it in code if you'd prefer. Check out the "Where Does The Theme Style Come From" in this article.

The code:

Style ts = typeof(Button).GetProperty("ThemeStyle",
   BindingFlags.NonPublic | BindingFlags.Instance).GetValue(myButton,
   null) as Style;

[DO NOT USE THIS CODE IN A PRODUCTION ENVIRONMENT]

Simon P Stevens
Thanks, exactly what I needed !
Nils