这里是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>
我也有MainWindow.xaml。在VS中的设计模式下查看时,它的背景确实是灰色的,因为它应该是。无论如何,当应用程序运行时,窗口的背景是默认的白色。
为什么?
如何解决这个问题?我希望所有的窗口默认都有标准的背景。
谢谢!即使 起作用。 –