更改强调色彩在Windows 10 UWP [英] Change Accent Color in Windows 10 UWP

查看:174
本文介绍了更改强调色彩在Windows 10 UWP的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我真的不希望使用用户选择在Windows在我的应用程序的强调色,而是希望有我自己的颜色显示。
我可以手动通过新的风格改变它的所有项目,但它只是在正常对照这么多的地方,这将是很好的应用层面做的。

I dont really want to use the accent color that the user has chosen in Windows in my app, and instead want to have my own color show. I can change it manually on all the items by by making new styles, but it is just in so many places in the normal controls, that it would be nice to do on the app level.

我试过设置<的SolidColorBrush X:键=SystemAccentColor颜色=#FFCB2128/> 但出于某种原因,做并指出了一些项目,变成别人喜欢灰色的视频控件。

I tried setting <SolidColorBrush x:Key="SystemAccentColor" Color="#FFCB2128" /> but for some reason that does noting on some items and turns others like the video controls gray.

推荐答案

在Win10 UWP,系统强调文字颜色定义为ThemeResourceSystemControlHighlightAccentBrush。
你可以将其覆盖如下

On Win10 UWP, System Accent color is defined as ThemeResource 'SystemControlHighlightAccentBrush'. You can override it as following.

<ResourceDictionary.ThemeDictionaries>
    <ResourceDictionary x:Key="Default">
        <SolidColorBrush x:Key="SystemControlHighlightAccentBrush" Color="Orange" />
    </ResourceDictionary>
    <ResourceDictionary x:Key="Dark">
        <SolidColorBrush x:Key="SystemControlHighlightAccentBrush" Color="Green" />
    </ResourceDictionary>
    <ResourceDictionary x:Key="Light">
        <SolidColorBrush x:Key="SystemControlHighlightAccentBrush" Color="Blue" />
    </ResourceDictionary>
</ResourceDictionary.ThemeDictionaries>

这篇关于更改强调色彩在Windows 10 UWP的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆