I cannot set the default background color for all my windows in my application. Does anyone know how to do this?
I am currently installing a theme in my App.xaml file as follows.
<Application> <Application.Resources> <ResourceDictionary Source="Themes/SomeTheme.xaml" />
It basically styles my whole application.
Inside SomeTheme.xaml I am trying to set the default color for all my windows like this.
<SolidColorBrush Color="{DynamicResource MainColor}" x:Key="CommonBackgroundBrush" /> <Style TargetType="{x:Type Window}"> <Setter Property="Background" Value="{DynamicResource CommonBackgroundBrush}" /> </Style>
This syntax is completely ignored for Window type derivatives.
Is there a way to make the style apply to all derivatives of Window ?
The strange thing about this syntax is that it actually shows the correct color in the VS preview window.
Nicholas
source share