Why doesn't style-setting of the window background work?

Viewed 6491

Here is the App.xaml:

<Application>
<Application.Resources>
    <ResourceDictionary>
        <Style TargetType="Window">
            <Setter Property="SnapsToDevicePixels" Value="True"/>
            <Setter Property="Background" Value="{DynamicResource {x:Static SystemColors.ControlBrushKey}}"/>
        </Style>
    </ResourceDictionary>
</Application.Resources>
</Application>

I also have the MainWindow.xaml. When viewed in Design mode in VS, it's background is, indeed, gray, as it should be. Anyway, when application is running, the window's background is default white.

Why?

How to fix this? I want all windows to have the standard background by default.

2 Answers
Related