Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to ignore the Default Style for a particular control?

Tags:

wpf

I am using a custom style that is applied to all expanders in my app.

<Style x:Key="{x:Type Expander}" TargetType="{x:Type Expander}">
</Style>

In one particular view, I would like to use the standard expander. How can I say it should ignore the custom style and use the built in one?

Unless there is no way and I have to mark the custom style with a key and apply it to all the other expanders with that key. (Therefore the inverse of what I trying to achieve)

I was just wondering if there is a better way to do this.

like image 641
Houman Avatar asked Feb 20 '12 13:02

Houman


1 Answers

Use <Expander ... Style="{x:Null}" ... /> in order to ignore the default style.

like image 112
Phil Avatar answered Sep 18 '22 15:09

Phil