xaml - UWP 全局覆盖默认画笔
问题描述
我正在尝试SolidColorBrush
为我的整个应用程序覆盖一些默认值:
<Application.Resources>
<ResourceDictionary>
<ResourceDictionary.ThemeDictionaries>
<ResourceDictionary x:Key="Light">
<SolidColorBrush x:Key="ListViewItemBackgroundSelected" Color="{ThemeResource SystemAccentColorLight1}"/>
<SolidColorBrush x:Key="ListViewItemBackgroundSelectedPointerOver" Color="{ThemeResource SystemAccentColorLight2}"/>
</ResourceDictionary>
<ResourceDictionary x:Key="Dark">
<SolidColorBrush x:Key="ListViewItemBackgroundSelected" Color="{ThemeResource SystemAccentColorDark1}"/>
<SolidColorBrush x:Key="ListViewItemBackgroundSelectedPointerOver" Color="{ThemeResource SystemAccentColorDark2}"/>
</ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
<ResourceDictionary>
</Application.Resources>
当我将这些特定添加SolidColorBrush
到我ThemeDictionary
的 in App.xaml
(我在那里放置了更多资源)时,它没有任何效果。
但是,当我将它ThemeDictionary
放在Application.Resources
aPage
中时,ListView
它确实有效果。
这里有什么问题,我该如何解决?
解决方案
推荐阅读
- ffmpeg - 基于时间的缩放 ffmpeg
- python - 不可散列类型的错误:'numpy.ndarray'
- excel - 我在 VBA 中的 For 循环没有按我的意愿工作
- django - 在 Django + Elastic Beanstalk 中将 EC2 公共 IP 添加到 ALLOWED_HOSTS 是否安全?
- python - 当条件运行时间太长时,pyspark multiple
- java - 在“connectGatt”之后不会调用蓝牙 LE“onConnectionStateChange”
- c - base-2:为什么 DECIMAL_DIG - DIG == 2 或 3?
- javascript - React Native tabnavigation 在单独的组件中?
- python - 两个 python 类如何声明相互引用和自身引用?
- reactjs - 从 GTM 脚本中减少未使用的 JavaScript