{"id":93637,"date":"2025-08-24T13:51:07","date_gmt":"2025-08-24T13:51:07","guid":{"rendered":"https:\/\/www.newsbeep.com\/ca\/93637\/"},"modified":"2025-08-24T13:51:07","modified_gmt":"2025-08-24T13:51:07","slug":"net-10-preview-7-accelerates-net-maui-with-xaml-source-generator","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/ca\/93637\/","title":{"rendered":".NET\u202f10 Preview\u202f7 Accelerates .NET MAUI with XAML Source Generator"},"content":{"rendered":"<p>On August 12th, Microsoft rolled out the <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/dotnet-10-preview-7\" rel=\"nofollow noopener\" target=\"_blank\">seventh preview of .NET MAUI in .NET 10<\/a>, introducing more performance improvements and some improvements in controls. This preview focuses on compile\u2011time XAML processing, richer media metadata support, safer UI layouts, and refined toolbar APIs.<\/p>\n<p>MAUI is an acronym that stands for Multiplatform Application UI. According to Microsoft, it\u2019s an evolution of Xamarin and Xamarin Forms frameworks, unifying separate target libraries and projects into a single project for multiple devices. Currently, <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/maui\/supported-platforms\" rel=\"nofollow noopener\" target=\"_blank\">MAUI supports<\/a> writing applications that run on Android 5+, iOS 12.2+, macOS 12+ (as <a href=\"https:\/\/developer.apple.com\/documentation\/uikit\/mac_catalyst\" rel=\"nofollow noopener\" target=\"_blank\">Mac Catalyst<\/a>), Samsung Tizen, Windows 10 version 1809+, or Windows 11. There are no changes in the supported minimum platforms from the version 9, <a href=\"https:\/\/www.infoq.com\/news\/2024\/11\/net-maui-9-ga\/\" rel=\"nofollow noopener\" target=\"_blank\">released last year<\/a>.<\/p>\n<p>XAML markup is now compiled at build time instead of being interpreted at runtime. This change reduces app startup latency, surfaces XAML errors earlier in the developer workflow, and enables developers to inspect the generated code for gaining a deeper insight. In order to enable build-time XAML compilation, developer must add the EnablePreviewFeatures property in the project and decorate their root namespace with XamlProcessing attribute.<\/p>\n<p>&#13;<br \/>\n&#13;<br \/>\n  true&#13;<br \/>\n&#13;<br \/>\n&#13;<br \/>\n[assembly: XamlProcessing(XamlInflator.SourceGen)]&#13;<br \/>\nnamespace MyApp;<\/p>\n<p>When selecting images via <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/microsoft.maui.media.mediapicker?view=net-maui-10.0\" rel=\"nofollow noopener\" target=\"_blank\">MediaPicker control<\/a>, MAUI now can handle embedded EXIF metadata, such as orientation, timestamps, or geolocation data. This makes image handling richer in features (such as automatic rotation of the photos) and more reliable for apps that rely on metadata. The new update also preserves any existing EXIF metadata in the image when passed downstream after being picked.<\/p>\n<p>This release adds several new features for the Safe Area, the feature in MAUI that prevents content being rendered outside the device-specific screen space that can be overlaid with other content (camera notch, rounded corners and similar UI elements). Layout logic around notches, rounded corners, and display cutouts is now smarter, giving developers finer control over content positioning across devices with varying safe areas. The developers add the SafeAreaEdges property to the content control and choose between several options to show their content, namely:<\/p>\n<p>&#13;<br \/>\npublic enum SafeAreaRegions&#13;<br \/>\n{&#13;<br \/>\n    None = 0,          \/\/ Edge-to-edge content (no safe area padding)&#13;<br \/>\n    SoftInput = 1,     \/\/ Always pad for keyboard\/soft input&#13;<br \/>\n    Container = 2,     \/\/ Flow under keyboard, stay out of bars\/notch  &#13;<br \/>\n    Default = 4,       \/\/ Platform default behavior&#13;<br \/>\n    All = int.MaxValue \/\/ Obey all safe area insets&#13;<br \/>\n}<\/p>\n<p>The <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/maui\/user-interface\/toolbaritem?view=net-maui-10.0\" rel=\"nofollow noopener\" target=\"_blank\">toolbars in .NET MAUI 10 Preview 7<\/a> can now include secondary items, which will be rendered as device-specific secondary menu items. To do so, the <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/microsoft.maui.controls.toolbaritem?view=net-maui-10.0\" rel=\"nofollow noopener\" target=\"_blank\">ToolbarItem<\/a> markup has to include the <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/microsoft.maui.controls.toolbaritemorder?view=net-maui-10.0\" rel=\"nofollow noopener\" target=\"_blank\">Order property<\/a>, set to either Primary or Secondary.\u00a0Usually, the secondary items are hidden behind an ellipsis in the action menu.<\/p>\n<p><img decoding=\"async\" alt=\"Screenshot of secondary toolbar ellipsis on Android.\" src=\"https:\/\/www.newsbeep.com\/ca\/wp-content\/uploads\/2025\/08\/android-dots.png\" rel=\"share\"\/><\/p>\n<p><img decoding=\"async\" alt=\"Screenshot of secondary toolbar items in vertical list on Android.\" src=\"https:\/\/www.newsbeep.com\/ca\/wp-content\/uploads\/2025\/08\/android-secondaries.png\" rel=\"share\"\/><\/p>\n<p>Finally, several new APIs have been added to controls, such as controling pickers&#8217;\u00a0open and close states programatically, search handler&#8217;s hide or show soft keyboard or exposing TabbedPageManager class. Some deprecated APIs have been removed in this preview, for example\u00a0Accelerator class was removed from Microsoft.Maui.Controls and\u00a0ClickGestureRecognizer was removed in favor of <a href=\"https:\/\/learn.microsoft.com\/en-us\/dotnet\/api\/microsoft.maui.controls.tapgesturerecognizer?view=net-maui-10.0\" rel=\"nofollow noopener\" target=\"_blank\">TapGestureRecognizer<\/a>.<\/p>\n<p>Developers\u2019 feedback to this new release is generally positive. <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/dotnet-10-preview-7\" rel=\"nofollow noopener\" target=\"_blank\">Stuart Ballard said<\/a>\u00a0on the Microsoft DevBlog:<\/p>\n<p>&#13;<\/p>\n<p>Xaml source generator sounds awesome \u2013 is there a reason why it\u2019s limited to MAUI rather than being general-purpose and usable with WPF etc?<\/p>\n<p>&#13;<\/p>\n<p>A <a href=\"https:\/\/windowsforum.com\/threads\/net-10-preview-7-websocketstream-passkeys-maui-xaml-generator.377626\/\" rel=\"nofollow noopener\" target=\"_blank\">post on windowsforum.com<\/a> stated that Preview\u202f7 is a consolidation pass and a late-stage milestone focusing on quality improvements across MAUI. Although not a direct opinion, it reinforces the community\u2019s understanding: Preview\u202f7 is less about flashy new features and more about polishing what\u2019s there already.<\/p>\n<p>Readers can refer to GitHub official MAUI repository for <a href=\"https:\/\/github.com\/dotnet\/core\/blob\/main\/release-notes\/10.0\/preview\/preview7\/dotnetmaui.md\" rel=\"nofollow noopener\" target=\"_blank\">complete release notes<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"On August 12th, Microsoft rolled out the seventh preview of .NET MAUI in .NET 10, introducing more performance&hellip;\n","protected":false},"author":2,"featured_media":93638,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[6],"tags":[17716,22861,49,48,4113,54896,61],"class_list":["post-93637","post","type-post","status-publish","format-standard","has-post-thumbnail","category-technology","tag-net","tag-net-maui","tag-ca","tag-canada","tag-development","tag-maui-10-preview7","tag-technology"],"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts\/93637","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/comments?post=93637"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts\/93637\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/media\/93638"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/media?parent=93637"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/categories?post=93637"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/tags?post=93637"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}