0
votes

I'm using the aero theme in my application which changes all my default styles of the controls. I figured creating a style with no x:Key would override the default aero style but it does not. Any suggestions?

<Style TargetType="{x:Type ScrollBar}">
<Setter Property="Background" Value="#ff007eb1"/>
<Setter Property="BorderBrush" Value="Transparent"/>
<Style.Triggers>
    <Trigger Property="Orientation" Value="Vertical">
        <Setter Property="Width" Value="5"/>
        <Setter Property="Height" Value="Auto" />
        <Setter Property="Template" Value="{StaticResource VerticalScrollBar}" />
    </Trigger>
    <Trigger Property="Orientation" Value="Horizontal">
        <Setter Property="Width" Value="Auto"/>
        <Setter Property="Height" Value="5" />
        <Setter Property="Template" Value="{StaticResource HorizontalScrollBar}" />
    </Trigger>
</Style.Triggers>      

1
Are the scroll bars declared in your XAML or are you just expecting this style to override scrollbars everywhere? - Dave White
I expect this style to override scrollbars everywhere and it does when I don't use the aero theme. - Robert

1 Answers

0
votes

Some properties of the Aero style will only change if you replace the complete controltemplate of a control. A style will not change everything.