How can I override the button lineargradient brush in Aero?

Mar 9, 2009 at 3:25 PM
I have created an aero.normalcolor.xml and added it to my themes folder.  And things I put in there take effect.  So I know I have things setup up properly to recognize my themes.

So I changed the menu style like this:

   <LinearGradientBrush x:Key="ShadedBackground"
            <GradientStop Color="#FFFFFF" Offset="0.0"/>
            <GradientStop Color="#E5EAF5" Offset="0.409090909"/>
            <GradientStop Color="#D3DAED" Offset="0.454545454"/>
            <GradientStop Color="#DFE4F4" Offset="1.0"/>

   <Style x:Key="{x:Type Menu}"
           TargetType="{x:Type Menu}">
      <Setter Property="Background"
                Value="{StaticResource ShadedBackground}"/>

And now I want to override a plain button style also.  (not the isDefaulted style etc.  just the plain button with no special properties)

So I tried this:

   <Style x:Key="{x:Type BaseButtonStyle}"
           TargetType="{x:Type ButtonBase}">
      <Setter Property="Background"
                Value="{StaticResource ShadedBackground}"/>

I used BaseButtonStyle because that was what was in the PresentationFramework aero xaml.

But I get the message:

Error    31    (MC3050) Cannot find the type 'BaseButtonStyle'. Note that type names are case sensitive. Line 30 Position 11.    C:\Users\mtiede\Documents\Visual Studio 2008\Projects\crap\WindowsApplication6\WindowsApplication6\Themes\aero.normalcolor.xaml    30    11    WindowsApplication6

How should I access the style of the button so that I can add color gradient to it?

Mar 9, 2009 at 3:33 PM
I changed BaseButtonStyle to Button and it seemed to work.  I think when I first tried that, it didn't show up at design time because I didn't recompile the program first.