How do I define the default background color for window instances in a shared ResourceDictionary?
- by Nicholas
I can't seem to set a default background color for all of my windows in my application. Does anyone know how to do this?
Currently I'm setting a theme in my App.xaml file like this.
<Application>
<Application.Resources>
<ResourceDictionary Source="Themes/SomeTheme.xaml" />
This basically styles my entire application.
Inside of SomeTheme.xaml I am trying to set a default color for all of my windows like this.
<Style TargetType="{x:Type Window}">
<Setter Property="Background" Value="{DynamicResource MainColor}" />
</Style>
This syntax works on a type of Button, but is completely ignored for Window.
What am I doing wrong? Is there something special I have to do for a Window type.