XAML 在UWP应用程序中添加新的主题颜色?

anhgbhbe  于 12个月前  发布在  其他
关注(0)|答案(1)|浏览(86)

所以我有一个使用UWP程序的人,他们有阅读障碍,并询问是否可以改变背景和文本颜色,使他们更容易阅读文本。目前的应用程序有光,暗和默认的主题,有从模板,我还没有触及他们。我已经制定了我可以编辑颜色的黑暗/光明/默认与以下添加到App.xaml文件。(我只测试了一种笔刷颜色)。理想情况下,我宁愿添加另一个主题,而不是编辑基本的主题。有没有地方详细说明如何做到这一点?

<ResourceDictionary.ThemeDictionaries>
    <ResourceDictionary x:Key="Default">
        <SolidColorBrush x:Key="SystemControlPageBackgroundChromeLowBrush" Color="BlueViolet" />
    </ResourceDictionary>
    <ResourceDictionary x:Key="Dark">
        <SolidColorBrush x:Key="SystemControlPageBackgroundChromeLowBrush" Color="IndianRed" />
    </ResourceDictionary>
    <ResourceDictionary x:Key="Light">
        <SolidColorBrush x:Key="SystemControlPageBackgroundChromeLowBrush" Color="DarkOliveGreen" />
    </ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>
js5cn81o

js5cn81o1#

目前UWP无法添加额外的主题,XuptedTheme只能选择LightDark
您可以尝试使用Contrast themes,用户也可以在设置>辅助功能>对比度主题中设置适合自己的颜色。

相关问题