Expander header styling #3002
-
We want to change the header style of the Expander control. We followed this example to override the MaterialDesign style: Unfortunately this does not work for the header. Overriding the style for the whole expander works but not for the header only. What am i missing? MaterialDesignThemes.Overrides.xaml
App.xaml
MainWindow.xaml
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
@MrHaribo So there are a couple of issues here. I'll try to break it down. You are missing an explicit key on the <!--This does NOT work-->
<Style x:Key="MaterialDesignHorizontalHeaderStyle"
BasedOn="{StaticResource MaterialDesignHorizontalHeaderStyle}"
TargetType="{x:Type ToggleButton}">
<Setter Property="Foreground" Value="Aqua"/>
</Style> However, even with that in place it still does not work. To my knowledge, you cannot "hijack" just the Accomplishing what you want will require you to essentially override the style for the One last issue with the sample you provide is that you set the I guess, depending on what you're trying to accomplish, you probably need to override both styles and adjust (them both) to your needs. I hope this helps to explain the problem. |
Beta Was this translation helpful? Give feedback.
@MrHaribo So there are a couple of issues here. I'll try to break it down.
You are missing an explicit key on the
Style
based on theMaterialDesignHorizontalHeaderStyle
. It should be defined with anx:Key
(explicit key) like it is inMaterialDesignTheme.Expander.xaml
:However, even with that in place it still does not work. To my knowledge, you cannot "hijack" just the
MaterialDesignHorizontalHeaderStyle
style in this manner because of the way W…