Search code examples
wpfexpander

Style WPF Expander icon like TreeView expander


I would like to style my WPF expander like the expanders used in this TreeView from Windows 7 (see screenshot below). Are there any styles available to do this?

Edit: I am interested in the expander style -- specifically the small triangular expansion indicator

Sample Expander Style


Solution

  • See Ritch's comment above -- the solution is to use Blend to extract the default control template for the TreeView.

    Turns out the tree view default template contains a special control template for a ToggleButton that is being used to display the expansion indicator. If you take that template and inject it into the template that Expander uses for its expansion toggle button then you are all set