3
votes

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

1
You mean the icons and folder names, or the toggles? That's really a tree view of course.Ritch Melton
@Ritch updated -- Interested in the expander style that the tree view is usingcordialgerm
Ok, just open up blend and yank out the default control template for the treeview.Ritch Melton
@Ritch Thanks that turned out to be exactly what I neededcordialgerm
Its a pretty common question.Ritch Melton

1 Answers

2
votes

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