I am trying to override the default style of a basic control (TextBox, ComboBox) in a theme file. Like this:
in topics /classic.xaml
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Background" Value="Black"/>
</Style>
in topics /Aero.NormalColor.xaml
<Style TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Background" Value="Green"/>
</Style>
But this does not seem to work. I always get the default style unchanged. I even tried it with a specific key as
<Style x:Key="DefaultTextBoxStyle" TargetType="{x:Type TextBox}" BasedOn="{StaticResource {x:Type TextBox}}">
<Setter Property="Background" Value="Green"/>
</Style>
and always use this key when declaring a control in xaml. Nothing seems to work.
If I put the style in the application.xaml file, I have no problem, but I want this style to be theme dependent. By the way, it works well with my own users.
Can someone tell me what I'm doing wrong here?
, , , somesort, xaml.