I have an Expander in Silverlight 4 that I am trying to style. Specifically, I want to override the default look of the ToggleButton used in the Expander. How do I go about doing this? I've written some style for the Expander so far, but I can seem to find the place to override the default ToggleButton style.
Asked
Active
Viewed 1,602 times
2 Answers
4
This MSDN page gives a pretty complete description of what is needed to override the Expander.
If you have Expression Blend, another option is to start a new project in Blend, insert an expander on your window/usercontrol, then right-click on it and choose 'Edit Template'. Then you can change just the pieces you want. For my needs, this functionality in Blend is worth the cost of this software by itself.

Stewbob
- 16,759
- 9
- 63
- 107
-
Thanks, that link does a pretty good job explaining it. I was hoping to avoid writing a ControlTemplate, but I think there's no way around it. – TheEnigmaMachine Jul 05 '11 at 20:23
-
Yes. With a control as complex as the expander, a control template is needed because all of those individual parts can be(must be) styled individually. – Stewbob Jul 05 '11 at 20:24
1
You will need to replace the whole expander template since the expander stores the togglebutton templates (it has one for each direction) in its template and offers no way for you to provide your own.

AnthonyWJones
- 187,081
- 35
- 232
- 306