我有一个使用属性网格的 C# 应用程序。当我编辑 ContentAlignment 属性时,我收到此错误消息:
Desktop applications are required to opt in to all earlier accessibility improvements to get the later improvements. To do this, ensure that if the AppContext switch 'Switch.UseLegacyAccessibilityFeatures.N' is set to 'false', then 'Switch.UseLegacyAccessibilityFeatures' and all 'Switch.UseLegacyAccessibilityFeatures.M' switches, when M < N, evaluate to false as well. Note that, if a switch for a particular set of accessibility improvements is not present, its value is determined by the target framework version. You can remedy this by adding these switches and setting their value to false.
这可能与更新框架到4.6.1有关。
我只在第一次编辑属性时看到此错误。
如何选择加入可访问性改进以不看到此错误?
最佳答案
根据博文.NET Framework 4.7.1 Accessibility and WPF Improvements ,如果您的应用程序在 .NET Framework 4.7.1 或更高版本上运行但以更早的 .NET Framework 为目标,您需要将以下内容添加到您的 app.config 文件中以选择加入辅助功能改进。
<runtime>
<!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true|false;key2=true|false -->
<AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false" />
</runtime>
关于c# - 如何选择加入可访问性改进?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/50417999/