WPF Window Style not working at runtime
- by Christian Pena
Hi,
I created a WPF application in Visual Studio 2010 Express (C#) and added the text below to the Application.Resources in App.xaml. I see the style applied to the window in the designer, but when I run the application, the window background is white.
Running in Windows XP on BootCamp on a MacBook Pro if that is a factor.
Thanks in advance,
Christian
<Style TargetType="{x:Type Window}">
<Setter Property="Background">
<Setter.Value>
<LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
<GradientStop Offset="0" Color="WhiteSmoke" />
<GradientStop Offset="1" Color="Silver" />
</LinearGradientBrush>
</Setter.Value>
</Setter>
<Setter Property="Padding" Value="20" />
</Style>