How to ignore “ease of access” settings on Windows

2019-09-04 10:33发布

问题:

There are 'TextSize' and 'High contrast' settings in 'ease of access' settings category on Windows Phone. Is there a way to ignore them or make an app to follow my own accessibility styles?

回答1:

It's a common bug in apps that they ignore the high contrast settings and hardcode their own colours. So yes: you can do this by doing the wrong thing and hardcoding your settings instead of using the system resources. You can override most system brushes in your app resources in app.xaml and you can hardcode colours in your Xaml and control styles.

That said, please use this for good not evil. People choose these options because they need them. Use the HighContrast dictionary to make sure your non-standard styles follow the users high contrast theme request rather than to avoid it:

<ResourceDictionary.ThemeDictionaries> 
    <ResourceDictionary x:Key="Default"> 
        <ImageBrush x:Key="PageBackground" Stretch="Fill" ImageSource="Assets/owlvcrow.jpg"/> 
    </ResourceDictionary> 
    <ResourceDictionary x:Key="HighContrast"> 
        <SolidColorBrush x:Key="PageBackground" Color="{ThemeResource SystemColorWindowColor}" /> 
    </ResourceDictionary> 
</ResourceDictionary.ThemeDictionaries>