{"id":22467,"date":"2019-04-18T13:12:27","date_gmt":"2019-04-18T20:12:27","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=22467"},"modified":"2019-04-18T22:38:33","modified_gmt":"2019-04-19T05:38:33","slug":"announcing-the-net-framework-4-8","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-the-net-framework-4-8\/","title":{"rendered":"Announcing the .NET Framework 4.8"},"content":{"rendered":"<p>We are thrilled to announce the release of the .NET Framework 4.8 today. It\u2019s included in the Windows 10 May 2019 Update. .NET Framework 4.8 is also available on Windows 7+ and Windows Server 2008 R2+.<\/p>\n<p>You can install .NET 4.8 from our<a href=\"https:\/\/dotnet.microsoft.com\/download\/dotnet-framework\">\u00a0.NET Download site<\/a>. For building applications targeting .NET Framework 4.8, you can download the <a href=\"https:\/\/go.microsoft.com\/fwlink\/?linkid=2088517\" target=\"_blank\" rel=\"noopener\">NET 4.8 Developer Pack<\/a>. If you just want the .NET 4.8 runtime, you can try:<\/p>\n<ul>\n<li><a href=\"http:\/\/go.microsoft.com\/fwlink\/?LinkId=2085155\" target=\"_blank\" rel=\"noopener\">.NET 4.8 Web Installer <\/a> \u2013 requires an internet connection during installation<\/li>\n<li>.<a href=\"https:\/\/go.microsoft.com\/fwlink\/?linkid=2088631\" target=\"_blank\" rel=\"noopener\">NET 4.8 Offline installer<\/a> \u2013 can be downloaded and installed later in a disconnected state<\/li>\n<\/ul>\n<p>The\u00a0.NET Framework 4.8\u00a0includes an updated toolset as well as improvements in several areas:<\/p>\n<ul>\n<li><strong>[Runtime]<\/strong>\u00a0JIT and NGEN Improvements<\/li>\n<li><strong>[BCL]<\/strong>\u00a0Updated ZLib<\/li>\n<li><strong>[BCL]<\/strong>\u00a0Reducing FIPS Impact on Cryptography<\/li>\n<li><strong>[WinForms]<\/strong>\u00a0Accessibility Enhancements<\/li>\n<li><strong>[WCF]<\/strong>\u00a0Service Behavior Enhancements<\/li>\n<li><strong>[WPF]<\/strong>\u00a0High DPI Enhancements, UIAutomation Improvements<\/li>\n<\/ul>\n<p>You can see the complete list of improvements in the\u00a0<a href=\"https:\/\/github.com\/Microsoft\/dotnet\/tree\/master\/releases\/net48\/README.md\">.NET Framework 4.8 release notes<\/a>.\u00a0<a href=\"https:\/\/go.microsoft.com\/fwlink\/?LinkId=2053898\">Reference sources<\/a> have also been updated for .NET 4.8.<\/p>\n<h3><\/h3>\n<h3>Supported Windows Versions<\/h3>\n<p><strong>Windows Client versions: <\/strong>Windows 10 version 1903, Windows 10 version 1809, Windows 10 version 1803, Windows 10 version 1709, Windows 10 version 1703, Windows 10 version 1607, Windows 8.1, Windows 7 SP1\n<strong>Windows Server versions:<\/strong> Windows Server 2019, Windows Server version 1803, Windows Server 2016, Windows Server 2012, Windows Server 2012 R2, Windows Server 2008 R2 SP1<\/p>\n<h3><\/h3>\n<h3>New Features in .NET Framework 4.8<\/h3>\n<h4>Runtime &#8211; JIT improvements<\/h4>\n<p>The JIT in .NET 4.8 is based on .NET Core 2.1.\u00a0 All bug fixes and many code generation-based performance optimizations from .NET Core 2.1 are now available in the .NET Framework.<\/p>\n<h4>Runtime &#8211; NGEN improvements<\/h4>\n<p>NGEN images in the .NET Framework no longer contain writable &amp; executable sections. This reduces the surface area available to attacks that attempt to execute arbitrary code by modifying memory that will be executed.<\/p>\n<p>While there will still be writable &amp; executable data in memory at runtime, this change removes those mapped from NGEN images, allowing them to run in restricted environments that don\u2019t permit executable\/writable sections in images.<\/p>\n<h4>Runtime &#8211;\u00a0Antimalware Scanning for All Assemblies<\/h4>\n<p>In previous versions of .NET Framework, Windows Defender or third-party antimalware software would automatically scan all assemblies loaded from disk for malware. However, assemblies loaded from elsewhere, such as by using Assembly.Load(byte[]), would not be scanned and could potentially carry viruses undetected.<\/p>\n<p>.NET Framework 4.8 on Windows 10 triggers scans for those assemblies by Windows Defender and many other antimalware solutions that implement the <a href=\"https:\/\/cloudblogs.microsoft.com\/microsoftsecure\/2015\/06\/09\/windows-10-to-offer-application-developers-new-malware-defenses\/\">Antimalware Scan Interface<\/a>. We expect that this will make it harder for malware to disguise itself in .NET programs.<\/p>\n<h4>BCL \u2013 Updated ZLib<\/h4>\n<p>Starting with .NET Framework 4.5 we used the native version of ZLib (a native external compression library used for data compression) from\u00a0<a href=\"http:\/\/zlib.net\/\">http:\/\/zlib.net<\/a>\u00a0in clrcompression.dll in order to provide an implementation for the deflate algorithm. In .NET Framework 4.8 we updated clrcompression.dll to use version 1.2.11 which includes several <a href=\"http:\/\/zlib.net\/ChangeLog.txt\">key improvements and fixes<\/a>.<\/p>\n<h4>BCL \u2013 Reducing FIPS Impact on Cryptography<\/h4>\n<p>.NET Framework 2.0+ have cryptographic provider classes such as SHA256Managed, which throw a CryptographicException when the system cryptographic libraries are configured in \u201cFIPS mode\u201d. These exceptions are thrown because the managed versions have not undergone FIPS (Federal Information Processing Standards) 140-2 certification (JIT and NGEN image generation would both invalidate the certificate), unlike the system cryptographic libraries. Few developers have their development machines in \u201cFIPS mode\u201d, which results in these exceptions being raised in production (or on customer systems). The \u201cFIPS mode\u201d setting was also used by .NET Framework to block cryptographic algorithms which were not considered an approved algorithm by the FIPS rules.<\/p>\n<p>For applications built for .NET Framework 4.8, these exceptions will no longer be thrown (by default). Instead, the SHA256Managed class (and the other managed cryptography classes) will redirect the cryptographic operations to a system cryptography library. This policy change effectively removes a potentially confusing difference between developer environments and the production environments in which the code runs and makes native components and managed components operate under the same cryptographic policy.<\/p>\n<p>Applications targeting .NET Framework 4.8 will automatically switch to the newer, relaxed policy and will no longer see exceptions being thrown from MD5Cng, MD5CryptoServiceProvider, RC2CryptoServiceProvider, RIPEMD160Managed, and RijndaelManaged when in \u201cFIPS mode\u201d. Applications which depend on the exceptions from previous versions can return to the previous behavior by setting the AppContext switch \u201cSwitch.System.Security.Cryptography.UseLegacyFipsThrow\u201d to \u201ctrue\u201d.<\/p>\n<h4>Windows Forms &#8211; Accessibility Enhancements<\/h4>\n<p>In .NET Framework 4.8 WinForms is adding three new features to enable developers to write more accessible applications. The features added are intended to make communication of application data to visually impaired users more robust. We\u2019ve added support for ToolTips when a user navigates via the keyboard, we\u2019ve added LiveRegions and Notification Events to many commonly used controls.<\/p>\n<p>To enable these features your application needs to have the following AppContextSwitches enabled in the App.config file:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/c31955a90ef479e5c213c0b2aa4fce59.js\"><\/script><\/p>\n<h4>Windows Forms &#8211;\u00a0UIA LiveRegions Support in Labels and StatusStrips<\/h4>\n<p>UIA Live Regions allow application developers to notify screen readers of a text change on a control that is located apart from the location where the user is working. Examples of where this would come in handy could be a StatusStrip that shows a connection status. If the connection is dropped and the Status changes, the developer might want to notify the screen reader of this change. Windows Forms has implemented UIA LiveRegions for both the Label control and the StatusStrip control.<\/p>\n<p>Example use of the LiveRegion in a Label Control:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/9f0744999aebb003fe4eaae947ec9fd6.js\"><\/script><\/p>\n<p>Narrator will now announce \u201cReady\u201d Regardless of where the user is interacting with the application.\nYou can also implement your UserControl as a Live region:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/0c5c15fa6b9f9554f23a358658f2ecc4.js\"><\/script><\/p>\n<h4>Windows Forms &#8211;\u00a0UIA Notification Events<\/h4>\n<p>In Windows 10 Fall Creators Update Windows introduced a new method of having an application notify Narrator that content has changed, and Narrator should announce the change. The UIA Notification event provides a way for your app to raise a UIA event which leads to Narrator simply making an announcement based on text you supply with the event, without the need to have a corresponding control in the UI. In some scenarios, this could be a straightforward way to dramatically improve the accessibility of your app.\u00a0 For more information about UIA Notification Events, see this <a href=\"https:\/\/blogs.msdn.microsoft.com\/winuiautomation\/2017\/11\/08\/can-your-desktop-app-leverage-the-new-uia-notification-event-in-order-to-have-narrator-say-exactly-what-your-customers-need\/\">blog post<\/a>.<\/p>\n<p>An example of where a Notification might come in handy is to notify the progress of some process that may take some time.<\/p>\n<p>An example of raising the Notification event:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/7b5c42f139da2122d65d3b43995ec084.js\"><\/script><\/p>\n<h4>Windows Forms &#8211;\u00a0ToolTips on keyboard access<\/h4>\n<p>Currently a control tooltip can only be triggered to pop up by moving a mouse pointer into the control. This new feature enables a keyboard user to trigger a control\u2019s tooltip by focusing the control using a Tab key or arrow keys with or without modifier keys. This particular accessibility enhancement requires an additional AppContextSwitch as seen in the following example:<\/p>\n<ol>\n<li>Create a new WinForms application<\/li>\n<li>Add the following XML to the App.config file<\/li>\n<\/ol>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/1ba5ff28c0b8a02adcf69ad11a980562.js\"><\/script><\/p>\n<ol start=\"3\">\n<li>Add several buttons and a ToolTip control to the application\u2019s form.<\/li>\n<li>Set tooltips for the buttons.<\/li>\n<li>Run the application and navigate between the buttons using a keyboard:<\/li>\n<\/ol>\n<p><img decoding=\"async\" class=\"aligncenter size-full wp-image-22505\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/Tooltip3646.jpg\" alt=\"\" width=\"541\" height=\"216\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/Tooltip3646.jpg 541w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/Tooltip3646-300x120.jpg 300w\" sizes=\"(max-width: 541px) 100vw, 541px\" \/><\/p>\n<h4>Windows Forms &#8211;\u00a0DataGridView control accessible hierarchy changes<\/h4>\n<p>Currently the accessible hierarchy (UI Automation tree) shows the editing box tree element as a child of currently edited cell but not as a root child element of DataGridView. The hierarchy tree update can be observed using Inspect tool:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-22502 size-full\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/DataGridView-Heirarchy-Changes-1.jpg\" alt=\"\" width=\"781\" height=\"316\" srcset=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/DataGridView-Heirarchy-Changes-1.jpg 781w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/DataGridView-Heirarchy-Changes-1-300x121.jpg 300w, https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/DataGridView-Heirarchy-Changes-1-768x311.jpg 768w\" sizes=\"(max-width: 781px) 100vw, 781px\" \/><\/p>\n<h4>\u00a0WCF \u2013 ServiceHealthBehavior<\/h4>\n<p>Health endpoints have many benefits and are widely used by orchestration tools to manage the service based on the service health status. Health checks can also be used by monitoring tools to track and alert on the availability and performance of the service, where they serve as early problem indicators.<\/p>\n<p>ServiceHealthBehavior is a WCF service behavior that extends IServiceBehavior.\u00a0 When added to the ServiceDescription.Behaviors collection, it will enable the following:<\/p>\n<ul>\n<li>Return service health status with HTTP response codes: One can specify in the query string the HTTP status code for a HTTP\/GET health probe request.<\/li>\n<li>Publication of service health: Service specific details including service state and throttle counts and capacity are displayed using an HTTP\/GET request using the \u201c?health\u201d query string. Knowing and easily having access to the information displayed is important when trouble-shooting a mis-behaving WCF service.<\/li>\n<\/ul>\n<p>Config ServiceHealthBehavior:<\/p>\n<p>There are two ways to expose the health endpoint and publish WCF service health information: by using code or by using a configuration file.<\/p>\n<ol>\n<li><strong>Enable health endpoint using code\u00a0<\/strong><\/li>\n<\/ol>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/b2187df09206e9a96078d9d2e299f362.js\"><\/script><\/p>\n<ol start=\"2\">\n<li><strong>Enable health endpoint using config<\/strong><\/li>\n<\/ol>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/0840f9d894753166e7ef2ab79fea1522.js\"><\/script>\n<strong>Return service health status with HTTP response codes:<\/strong><\/p>\n<p>Health status can be queried by query parameters (OnServiceFailure, OnDispatcherFailure, OnListenerFailure, OnThrottlePercentExceeded). HTTP response code (200 \u2013 599) can be specified for each query parameter. If the HTTP response code is omitted for a query parameter, a 503 HTTP response code is used by default.<\/p>\n<p><strong>Query parameters and examples:<\/strong><\/p>\n<ol>\n<li><strong> OnServiceFailure<\/strong>:<\/li>\n<\/ol>\n<ul>\n<li>Example: by querying https:\/\/contoso:81\/Service1?health&amp;OnServiceFailure=450, a 450 HTTP response status code is returned when ServiceHost.State is greater than CommunicationState.Opened.<\/li>\n<\/ul>\n<ol start=\"2\">\n<li><strong>OnDispatcherFailure<\/strong>:<\/li>\n<\/ol>\n<ul>\n<li>Example: by querying https:\/\/contoso:81\/Service1?health&amp;OnDispatcherFailure=45<u>5<\/u>, a 455 HTTP response status code is returned when the state of any of the channel dispatchers is greater than CommunicationState.Opened.<\/li>\n<\/ul>\n<ol start=\"3\">\n<li><strong>OnListenerFailure<\/strong>:<\/li>\n<\/ol>\n<ul>\n<li>Example: by querying https:\/\/contoso:81\/Service1?health&amp;OnListenerFailure=4<u>65<\/u>, a 465 HTTP response status code is returned when the state of any of the channel listeners is greater than CommunicationState.Opened.<\/li>\n<\/ul>\n<ol start=\"4\">\n<li><strong>OnThrottlePercentExceeded<\/strong>: Specifies the percentage {1 \u2013 100} that triggers the response and its HTTP response code {200 \u2013 599}.<\/li>\n<\/ol>\n<ul>\n<li>Example: by querying https:\/\/contoso:81\/Service1?health&amp;OnThrottlePercentExceeded= 70:350,95:500, when the throttle percentage is equal or larger than 95%, 500 the HTTP response code is returned; when the percentage is equal or larger than 70% and less then 95%, \u00a0 350 is returned; otherwise, 200 is returned.<\/li>\n<\/ul>\n<p><strong>Publication of service health:<\/strong><\/p>\n<p>After enabling the health endpoint, the service health status can be displayed either in html (by specifying the query string: https:\/\/contoso:81\/Service1?health) or xml (by specifying the query string: https:\/\/contoso:81\/Service1?health&amp;Xml) formats. https:\/\/contoso:81\/Service1?health&amp;NoContent returns empty html page.<\/p>\n<p><strong>Note:<\/strong><\/p>\n<p>It\u2019s best practice to always limit access to the service health endpoint. You can restrict access by using the following mechanisms:<\/p>\n<ol>\n<li>Use a different port for the health endpoint than what\u2019s used for the other services as well as use a firewall rule to control access.<\/li>\n<li>Add the desirable authentication and authorization to the health endpoint binding.<\/li>\n<\/ol>\n<h4>WPF &#8211; Screen narrators no longer announce elements with Collapsed or Hidden visibility<\/h4>\n<p>Elements with Collapsed or Hidden visibility are no longer announced by the screen readers. User interfaces containing elements with a Visibility of Collapsed or Hidden can be misrepresented by screen readers if such elements are announced to the user. In .NET Framework 4.8, WPF no longer includes Collapsed or Hidden elements in the Control View of the UIAutomation tree, so that the screen readers can no longer announce these elements.<\/p>\n<h4>WPF &#8211;\u00a0SelectionTextBrush Property for use with Non-Adorner Based Text Selection<\/h4>\n<p>In the .NET Framework 4.7.2 WPF added the ability to draw TextBox and PasswordBox text selection without using the adorner layer (<a href=\"https:\/\/github.com\/Microsoft\/dotnet\/blob\/master\/Documentation\/compatibility\/wpf-TextBox-PasswordBox-text-selection-does-not-follow-system-colors.md\">See Here<\/a>). The foreground color of the selected text in this scenario was dictated by <a href=\"https:\/\/docs.microsoft.com\/en-us\/dotnet\/api\/system.windows.systemcolors.highlighttextbrush?redirectedfrom=MSDN&amp;view=netframework-4.7.2#System_Windows_SystemColors_HighlightTextBrush\">SystemColors.HighlightTextBrush<\/a>.<\/p>\n<p>In the .NET Framework 4.8 we are adding a new property, SelectionTextBrush, that allows developers to select the specific brush for the selected text when using non-adorner based text selection.<\/p>\n<p>This property works only on TextBoxBase derived controls and PasswordBox in WPF applications with non-adorner based text selection enabled. It does not work on RichTextBox. If non-adorner based text selection is not enabled, this property is ignored.<\/p>\n<p>To use this property, simply add it to your XAML code and use the appropriate brush or binding.<\/p>\n<p>The resulting text selection will look like this:<\/p>\n<p><img decoding=\"async\" class=\"aligncenter wp-image-22507 size-full\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2019\/04\/3646Helloworldselectiontextbrush.jpg\" alt=\"\" width=\"247\" height=\"78\" \/><\/p>\n<p>You can combine the use of SelectionBrush and SelectionTextBrush to generate any color combination of background and foreground that you deem appropriate.<\/p>\n<h4>WPF &#8211;\u00a0High DPI Enhancements<\/h4>\n<p>WPF has added support for Per-Monitor V2 DPI Awareness and Mixed-Mode DPI scaling in .NET 4.8. Additional information about these Windows concepts is available <a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/hidpi\/high-dpi-desktop-application-development-on-windows\">here<\/a>.<\/p>\n<p>The latest <a href=\"https:\/\/github.com\/Microsoft\/WPF-Samples\/blob\/master\/PerMonitorDPI\/readme.md\">Developer Guide for Per monitor application development in WPF<\/a> states that only pure-WPF applications are expected to work seamlessly in a high-DPI WPF application and that Hosted HWND\u2019s and Windows Forms controls are not fully supported.<\/p>\n<p>.NET 4.8 improves support for hosted HWND\u2019s and Windows Forms interoperation in High-DPI WPF applications on platforms that support Mixed-Mode DPI scaling (Windows 10 v1803). When hosted HWND\u2019s or Windows Forms controls are created as Mixed-Mode DPI scaled windows, (as described in the \u201c<a href=\"https:\/\/docs.microsoft.com\/en-us\/windows\/desktop\/hidpi\/high-dpi-improvements-for-desktop-applications\">Mixed-Mode DPI Scaling and DPI-aware APIs<\/a>\u201d documentation by calling SetThreadDpiHostingBehavior and SetThreadDpiAwarenessContext API\u2019s), it will be possible to host such content in a Per-Monitor V2 WPF application and have them be sized and scaled appropriately. Such hosted content will not be rendered at the native DPI \u2013 instead, the OS will scale the hosted content to the appropriate size.<\/p>\n<p>The support for Per-Monitor v2 DPI awareness mode also allows WPF controls to be hosted (i.e., parented) under a native window in a high-DPI application. Per-Monitor V2 DPI Awareness support will be available on Windows 10 v1607 (Anniversary Update). Windows adds support for child-HWND\u2019s to receive DPI change notifications when Per-Monitor V2 DPI Awareness mode is enabled via the application manifest.<\/p>\n<p>This support is leveraged by WPF to ensure that controls that are hosted under a native window can respond to DPI changes and update themselves. For e.g.- a WPF control hosted in a Windows Forms or a Win32 application that is manifested as Per Monitor V2 \u2013 will now be able to respond correctly to DPI changes and update itself.<\/p>\n<p>Note that Windows supports Mixed-Mode DPI scaling on Windows 10 v1803, whereas Per-Monitor V2 is supported on v1607 onwards.<\/p>\n<p>To try out these features, the following application manifest and AppContext flags must be enabled:<\/p>\n<ol start=\"1\">\n<li>Enable Per-Monitor DPI in your application\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Turn on Per-Monitor V2 in your app.manifest<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/fb64b0d67d258c264ad9ed9827be65a8.js\"><\/script><\/li>\n<li>Turn on High DPI support in WPF<\/li>\n<\/ol>\n<ol start=\"2\">\n<li style=\"list-style-type: none;\"><\/li>\n<\/ol>\n<ol start=\"2\">\n<li style=\"list-style-type: none;\">\n<ul>\n<li>Target .NET Framework 4.6.2 or greater<\/li>\n<\/ul>\n<\/li>\n<\/ol>\n<p>and<\/p>\n<p>3. Set AppContext switch in your app.config<\/p>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/2f82fa5b771c85ce6260d0f674ce9d05.js\"><\/script><\/p>\n<p>Alternatively,<\/p>\n<p>Set AppContextSwitch Switch.System.Windows.DoNotUsePresentationDpiCapabilityTier2OrGreater=false in App.Config to enable Per-Monitor V2 and Mixed-Mode DPI support introduced in .NET 4.8.<\/p>\n<p>The runtime section in the final App.Config might look like this:\n<script src=\"https:\/\/gist.github.com\/NKarnam15\/18656f53e6c140c06248873144ec4084.js\"><\/script><\/p>\n<p>AppContext switches can also be set in registry. You can refer to the <a href=\"https:\/\/msdn.microsoft.com\/en-us\/library\/system.appcontext(v=vs.110).aspx\">AppContext Class<\/a> for additional documentation.<\/p>\n<h4>WPF &#8211;\u00a0Support for UIAutomation ControllerFor property<\/h4>\n<p>UIAutomation\u2019s ControllerFor property returns an array of automation elements that are manipulated by the automation element that supports this property. This property is commonly used for Auto-suggest accessibility. ControllerFor is used when an automation element affects one or more segments of the application UI or the desktop. Otherwise, it is hard to associate the impact of the control operation with UI elements. This feature adds the ability for controls to provide a value for ControllerFor property.<\/p>\n<p>A new virtual method has been added to AutomationPeer:\n<script src=\"https:\/\/gist.github.com\/NKarnam15\/4798d7f65753cce1d0eb0855b639eaaa.js\"><\/script><\/p>\n<p>To provide a value for the ControllerFor property, simply override this method and return a list of AutomationPeers for the controls being manipulated by this AutomationPeer:\n<script src=\"https:\/\/gist.github.com\/NKarnam15\/d79933dcbe5d1af1bf034664970b8274.js\"><\/script><\/p>\n<h4>WPF &#8211;\u00a0Tooltips on keyboard access<\/h4>\n<p>Currently tooltips only display when a user hovers the mouse cursor over a control. In .NET Framework 4.8, WPF is adding a feature that enables tooltips to show on keyboard focus, as well as via a keyboard shortcut.<\/p>\n<p>To enable this feature, an application needs to target .NET Framework 4.8 or opt-in via AppContext switch \u201cSwitch.UseLegacyAccessibilityFeatures.3\u201d and \u201cSwitch.UseLegacyToolTipDisplay\u201d.<\/p>\n<p>Sample App.config file:<\/p>\n<p><script src=\"https:\/\/gist.github.com\/NKarnam15\/8cdca1d27857b54383148a5ec1b937bd.js\"><\/script><\/p>\n<p>Once enabled, all controls containing a tooltip will start to display it once the control receives keyboard focus. The tooltip can be dismissed over time or when keyboard focus changes. Users can also dismiss the tooltip manually via a new keyboard shortcut Ctrl + Shift + F10. Once the tooltip has been dismissed it can be displayed again via the same keyboard shortcut.<\/p>\n<p>Note: RibbonToolTips on Ribbon controls won\u2019t show on keyboard focus \u2013 they will only show via the keyboard shortcut.<\/p>\n<h4>WPF &#8211;\u00a0Added Support for SizeOfSet and PositionInSet UIAutomation properties<\/h4>\n<p>Windows 10 introduced new UIAutomation properties SizeOfSet and PositionInSet which are used by applications to describe the count of items in a set. UIAutomation client applications such as screen readers can then query an application for these properties and announce an accurate representation of the application\u2019s UI.<\/p>\n<p>This feature adds support for WPF applications to expose these two properties to UIAutomation. This can be accomplished in two ways:<\/p>\n<ul>\n<li style=\"list-style-type: none;\">\n<ul>\n<li style=\"list-style-type: none;\">\n<ol>\n<li><strong>DependencyProperties\u00a0<\/strong><\/li>\n<\/ol>\n<\/li>\n<\/ul>\n<\/li>\n<\/ul>\n<p>New DependencyProperties SizeOfSet and PositionInSet have been added to the System.Windows.Automation.AutomationProperties namespace. A developer can set their values via XAML:\n<script src=\"https:\/\/gist.github.com\/NKarnam15\/9dac32e7eab213ac48ea2305c819fe68.js\"><\/script><\/p>\n<p><strong>\u00a0 \u00a0 2. AutomationPeer virtual methods\u00a0<\/strong><\/p>\n<p>Virtual methods GetSizeOfSetCore and GetPositionInSetCore have also been added to the AutomationPeer class. A developer can provide values for SizeOfSet and PositionInSet by overriding these methods:\n<script src=\"https:\/\/gist.github.com\/NKarnam15\/4ffae7683eadce15944f39f4d5a1c90e.js\"><\/script><\/p>\n<p><strong>\u00a0Automatic values\u00a0<\/strong><\/p>\n<p>Items in ItemsControls will provide a value for these properties automatically without additional action from the developer. If an ItemsControl is grouped, the collection of groups will be represented as a set and each group counted as a separate set, with each item inside that group providing its position inside that group as well as the size of the group. Automatic values are not affected by virtualization. Even if an item is not realized, it is still counted towards the total size of the set and affects the position in the set of it\u2019s sibling items.<\/p>\n<p>Automatic values are only provided if the developer is targeting .NET Framework 4.8 or has set the AppContext switch \u201cSwitch.UseLegacyAccessibilityFeatures.3\u201d \u2013 for example via App.config file:<\/p>\n<h3><script src=\"https:\/\/gist.github.com\/NKarnam15\/5810331fddcbbc139fdd32b4c280bcc3.js\"><\/script>\n<strong>Closing<\/strong><\/h3>\n<p>Please try out these\u00a0improvements in the .NET Framework 4.8\u00a0and share your feedback in the comments below or via <a href=\"https:\/\/github.com\/Microsoft\/dotnet\/issues\/\">GitHub<\/a>.<\/p>\n<p>Thank you!<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We are thrilled to announce the release of the .NET Framework 4.8 today. It\u2019s included in the Windows 10 May 2019 Update. .NET Framework 4.8 is also available on Windows 7+ and Windows Server 2008 R2+. You can install .NET 4.8 from our\u00a0.NET Download site. For building applications targeting .NET Framework 4.8, you can download [&hellip;]<\/p>\n","protected":false},"author":1321,"featured_media":58792,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,195],"tags":[],"class_list":["post-22467","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-dotnet-framework"],"acf":[],"blog_post_summary":"<p>We are thrilled to announce the release of the .NET Framework 4.8 today. It\u2019s included in the Windows 10 May 2019 Update. .NET Framework 4.8 is also available on Windows 7+ and Windows Server 2008 R2+. You can install .NET 4.8 from our\u00a0.NET Download site. For building applications targeting .NET Framework 4.8, you can download [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/22467","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/users\/1321"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=22467"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/22467\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/58792"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=22467"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=22467"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=22467"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}