Nic*_*las 7 wpf xaml themes window resourcedictionary
我似乎无法为我的应用程序中的所有窗口设置默认背景颜色.有谁知道如何做到这一点?
目前我正在我的App.xaml文件中设置一个主题.
<Application>
    <Application.Resources>
        <ResourceDictionary Source="Themes/SomeTheme.xaml" />
这基本上是整个应用程序的样式
在SomeTheme.xaml我的内部尝试为我的所有窗口设置默认颜色.
<SolidColorBrush Color="{DynamicResource MainColor}" x:Key="CommonBackgroundBrush" />
<Style TargetType="{x:Type Window}">
    <Setter Property="Background" Value="{DynamicResource CommonBackgroundBrush}" />
</Style>
对于类型的导数,此语法完全被忽略Window.
有没有办法强制风格适用于所有衍生品Window?
这种语法的奇怪之处在于它实际上在VS设计预览窗口中显示了正确的颜色.
| 归档时间: | 
 | 
| 查看次数: | 8870 次 | 
| 最近记录: |