Well I am trying to create some custom look and feel for my application without creating an entire theme. I've create a WPF 4.5 Application with a default Window and the following App.xaml
<Application x:Class="WpfBGTest.App"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
StartupUri="MainWindow.xaml">
<Application.Resources>
<Style TargetType="Window">
<Setter Property="Background" Value="Yellow" />
</Style>
</Application.Resources>
</Application>
And the entirely default window code
<Window x:Class="WpfBGTest.MainWindow"
xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
Title="MainWindow" Height="350" Width="525">
<Grid>
</Grid>
</Window>
By doing this I see that in Design Time my Window.xaml is yellow. But running the application the Window loses its yellow color and goes back to grey (current windows theme?)
What happens here? How can I customize my application without putting explicit StaticResource Markups on every control? My Style has a target type and no key. I do not understand why design time differs that much from runtime.
I've read enough about the issue with merged dictionaries but the code above is basically a vanilla WPF App with one style.
Edit: I've used Snoop to see that DefaultStyle is used when deciding what background will be fetched. But why? Watching the Dependecy Property precedence list: http://msdn.microsoft.com/en-us/library/ms743230.aspx my Application Style should be picked just before the default style