我正在使用VS2013创建一个简单的WPF项目,我想要对我的主窗口应用属性。我在App.xaml
文件中进行了如下设置:
<Application.Resources>
<Style TargetType="Window">
<Setter Property="Background" Value="#FF2D2D30" />
</Style>
</Application.Resources>
问题在于没有任何反应。但是当我将
TargetType
改为Grid时,Setter属性正常工作。为什么会这样呢?