在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
What's new in accessibility in the .NET Framework The .NET Framework aims(vt. 目的在于;引导;把…对准) at making applications more accessible for your users. Accessibility features allow an application to provide an appropriate experience for users of Assistive Technology. Starting with the .NET Framework 4.7.1, the .NET Framework includes a large number of accessibility improvements that allow developers to create accessible applications. Accessibility switchesYou can configure your app to opt into accessibility features if it targets the .NET Framework 4.7 or an earlier version but is running on the .NET Framework 4.7.1 or later. You can also configure your app to use legacy(n. 遗赠,遗产) features (and not take advantage of accessibility features) if it targets the .NET Framework 4.7.1 or later. Each version of the .NET Framework that includes accessibility features has a version-specific accessibility switch, which you add to the
Taking advantage of accessibility enhancementsThe new accessibility features are enabled by default for applications that target the .NET Framework 4.7.1 or later. In addition, applications that target an earlier version of the .NET Framework but are running on the .NET Framework 4.7.1 or later can opt out of legacy accessibility behaviors (and thereby(adv. 从而,因此;在那附近;在那方面) take advantage of accessibility improvements) by adding switches to the <runtime> <!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true|false;key2=true|false --> <AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false" /> </runtime> If you choose to opt in to accessibility features in a later version of the .NET Framework, you must also explicitly opt in to the features from earlier versions of the .NET Framework. Configuring your app to take advantage of accessibility improvements in both the .NET Framework 4.7.1 and 4.7.2 requires the following <runtime> <!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true|false;key2=true|false --> <AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures=false;Switch.UseLegacyAccessibilityFeatures.2=false" /> </runtime> Restoring legacy behaviorApplications that target versions of the .NET Framework starting with 4.7.1 can disable accessibility features by adding switches to the <runtime> <!-- AppContextSwitchOverrides value attribute is in the form of 'key1=true|false;key2=true|false --> <AppContextSwitchOverrides value="Switch.UseLegacyAccessibilityFeatures.2=true" /> </runtime> What's new in accessibility in the .NET Framework 4.7.2The .NET Framework 4.7.2 includes new accessibility features in the following areas: Windows FormsOS-defined colors in High Contrast(vi. 对比;形成对照) themes Starting with .NET Framework 4.7.2, Windows Forms uses colors defined by the operating system in High Contrast themes. This affects the following controls:
Narrator(n. 叙述者;解说员) improvements Starting with the .NET Framework 4.7.2, Narrator support is enhanced as follows:
DataGridView improvements Starting with the .NET Framework 4.7.2, the DataGridView control has introduced the following accessibility improvements:
Improved visual cues
Improved Property Grid Support
Improved keyboard navigation
Windows Presentation Foundation (WPF)Changes to the CheckBox and RadioButton controls In the .NET Framework 4.7.1 and earlier versions, the WPF CheckBox and RadioButton controls have inconsistent and, in Classic and High Contrast themes, incorrect focus visuals(adj. 视觉的,视力的;栩栩如生的). These issues occur in cases where the controls do not have any content set. This can make the transition(n. 过渡;转变;[分子生物] 转换;变调) between themes confusing and the focus visual hard to see. In the .NET Framework 4.7.2, these visuals are now more consistent across themes and more easily visible in Classic and High Contrast themes. WinForms controls hosted in a WPF application For WinForms control hosted in a WPF application in the .NET Framework 4.7.1 and earlier versions, users couldn't tab out of the WinForms layer if the first or last control in that layer is the WPF ElementHost control. In the .NET Framework 4.7.2, users are now able to tab out of the WinForms layer. However, automated applications that rely on focus never escaping the WinForms layer may no longer work as expected. What's new in accessibility in the .NET Framework 4.7.1The .NET Framework 4.7.1 includes new accessibility features in the following areas: Windows Presentation Foundation (WPF)Screen reader improvements If accessibility improvements are enabled, the .NET Framework 4.7.1 includes the following enhancements that affect screen readers:
UIAutomation LiveRegion support Screen readers such as Narrator help people read the UI contents of an application, usually by text-to-speech output of the UI content that has the focus. However, if a UI element changes and does not have the focus, the user may not be notified and may miss important information. Live regions aim at solving this problem. A developer can use them to inform(vt. 通知;告诉;报告) the screen reader or any other UIAutomation client that an important change has been made to a UI element. The screen reader can then decide how and when to inform the user of this change. To support live regions, the following APIs have been added to WPF:
You can create a LiveRegion by setting the AutomationProperties.LiveSetting property on the element of interest, as shown in the following example: <TextBlock Name="myTextBlock" AutomationProperties.LiveSetting="Assertive">announcement</TextBlock> When the data in the live region changes and you need to inform a screen reader, you explicitly raise an event, as shown in the following sample. var peer = FrameworkElementAutomationPeer.FromElement(myTextBlock); peer.RaiseAutomationEvent(AutomationEvents.LiveRegionChanged); High contrast Starting with the .NET Framework 4.7.1, improvements in high contrast have been made to various WPF controls. They are now visible when the HighContrast theme is set. These include:
For more information on WPF accessibility improvements in the .NET Framework 4.7.1, see Accessibility improvements in WPF. Windows Forms accessibility improvementsIn the .NET Framework 4.7.1, Windows Forms (WinForms) includes accessibility changes in the following areas. Improved display in High Contrast mode Starting with the .NET Framework 4.7.1, various WinForms controls offer improved rendering in the HighContrast modes available in the operating system. Windows 10 has changed the values for some high contrast system colors, and Windows Forms is based on the Windows 10 Win32 framework. For the best experience, run on the latest version of Windows and opt in to the latest OS changes by adding an app.manifest(vt. 证明,表明;显示) file in a test application and un-comment the Windows 10 supported OS line so that it looks the following: <!-- Windows 10 --> <supportedOS Id=”{8e0f7a12-bfb3-4fe8-b9a5-48fd50a15a9a}” /> Some examples of high contrast changes include:
Improved Narrator support Windows Forms in the .NET Framework 4.7.1 includes the following accessibility improvements for the Narrator:
Enhanced support for UIAutomation accessibility patterns Starting with the .NET Framework 4.7.1, developers of accessibility technology tools can leverage common API accessibility patterns and properties for several WinForms controls. These accessibility improvements include:
Improved property browser experience Starting with the .NET Framework 4.7.1, Windows Forms includes:
ASP.NET web controlsStarting with the .NET Framework 4.7.1 and Visual Studio 2017 15.3, ASP.NET improves how ASP.NET web controls work with accessibility technology in Visual Studio. Changes include the following:
.NET SDK ToolsThe Configuration Editor Tool (SvcConfigEditor.exe) and Service Trace Viewer Tool (SvcTraceViewer.exe) have been improved by fixing varied accessibility issues. Most of these were small issues, like a name not being defined or certain UI automation patterns not being implemented correctly. While many users won’t be aware of these incorrect values, customers who use assistive technologies like screen readers will find these SDK tools more accessible. These enhancements change some previous behaviors, such as keyboard focus order. Windows Workflow Foundation (WF) Workflow DesignerAccessibility changes in the Workflow Designer include the following:
See AlsoWhat's new in the .NET Framework |
2023-10-27
2022-08-15
2022-08-17
2022-09-23
2022-08-13
请发表评论