R – Silverlight – Default Gradient or Effect – How to turn it off

gradientsilverlightsilverlight-2.0

If you use this code in Silverlight and WPF you get slightly different results?

    <Button Name="SomeButton" Margin="10,15,180,12" Width="200" Height="50"
            VerticalAlignment="Top" Background="Black" Foreground="White">
   </Button>

In Silverlight you do not get a solid black Button. You get a vertical white-to-black gradient. How do you force this to be a solid color?

As a follow up, is their a similar method to counteract the annoying way Vista "decorates" buttons with the lightblue hover effect.

Thanks.

Best Answer

This is because the default template of the button between WPF and Silverlight is different; in Blend, go to "Template->Edit a Copy" to edit the button template and blow away the gradient.