{"id":33580,"date":"2021-07-14T09:07:43","date_gmt":"2021-07-14T16:07:43","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/dotnet\/?p=33580"},"modified":"2021-07-15T12:56:42","modified_gmt":"2021-07-15T19:56:42","slug":"announcing-net-maui-preview-6","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-maui-preview-6\/","title":{"rendered":"Announcing .NET MAUI Preview 6"},"content":{"rendered":"<p>Today with <a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/announcing-net-6-preview-6\/\" target=\"_blank\" rel=\"noopener\">.NET 6 Preview 6<\/a> we are shipping our latest progress on <a href=\"https:\/\/www.github.com\/dotnet\/maui\" target=\"_blank\" rel=\"noopener\">.NET Multi-platform App UI (MAUI)<\/a>. This release we are all-in on Visual Studio 2022 Preview 2. This also marks the first time we are shipping .NET MAUI as a workload installation. Several new capabilities are now available including gestures, modal pages, view clipping, native alerts, flex layout, and more. Single project also continues to be improved along with adopting the latest release of the Windows App SDK and Visual Studio extensions. Let&#8217;s take a deeper look.<\/p>\n<h2>Workload Installation<\/h2>\n<p>As part of .NET unification, we have introduced the concept of SDK workloads to enable specific developer scenarios on top of the .NET SDK you&#8217;ve installed. In preview 4 the underlying SDKs for Android, iOS, macOS, and Mac Catalyst were enabled, and now in preview 6 we are introducing the <code>maui<\/code>, <code>maui-mobile<\/code>, and <code>maui-desktop<\/code> workloads. The first will acquire and install all the required SDKs for building .NET MAUI applications. If you are only wanting to target mobile or desktop, you can choose those individually.<\/p>\n<p>In the near future Visual Studio 2022 will include these with its installer. To use them today, jump into your favorite CLI. First, take a look at what you have installed already:<\/p>\n<pre><code class=\"language-dotnetcli\">dotnet sdk check<\/code><\/pre>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2021\/07\/sdk-check.png\" alt=\"output of sdk check, Announcing .NET MAUI Preview 6\" width=\"1230\" height=\"1036\" \/><\/p>\n<p>This reports what has been installed via the .NET SDK installer itself. Now to see the additional workloads run:<\/p>\n<pre><code class=\"language-dotnetcli\">dotnet workload list<\/code><\/pre>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2021\/07\/workload-list.png\" alt=\"output of workload list, Announcing .NET MAUI Preview 6\" width=\"1844\" height=\"920\" \/><\/p>\n<p>To then install .NET MAUI you can execute:<\/p>\n<pre><code class=\"language-dotnetcli\">dotnet workload install maui<\/code><\/pre>\n<blockquote><p>What about the <code>maui-check<\/code> dotnet tool? We will continue to update <code>maui-check<\/code> with each release as it does additional validation of your development environment to help you be successful: checking for OpenJDK, emulators, Xcode, Visual Studio versions, and more.<\/p><\/blockquote>\n<p>For more information about mobile and desktop workloads, <a href=\"https:\/\/github.com\/dotnet\/maui-samples\/#dotnet-workload-install-command\">read details here<\/a>.<\/p>\n<h2>New .NET MAUI Capabilities<\/h2>\n<p>As you can see on <a href=\"https:\/\/github.com\/dotnet\/maui\/wiki\/Status\">our status report<\/a>, we are very close to being completely green for enabling features in .NET MAUI. Let&#8217;s highlight a few of the newcomers.<\/p>\n<h2>Gestures<\/h2>\n<p><a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/app-fundamentals\/gestures\/\">Gesture recognizers<\/a> allow you to apply tap, pinch, pan, swipe, and drag-and-drop to any view instance. You can apply them easily in XAML:<\/p>\n<pre><code class=\"language-xaml\">&lt;Grid&gt;\r\n    &lt;Grid.GestureRecognizers&gt;\r\n        &lt;TapGestureRecognizer NumberOfTapsRequired=\"2\" Command=\"{Binding OnTileTapped}\" \/&gt;\r\n    &lt;\/Grid.GestureRecognizers&gt;\r\n    &lt;!-- Grid content --&gt;\r\n&lt;\/Grid&gt;<\/code><\/pre>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2021\/07\/double-tap.gif\" alt=\"gif of Weather app reacting to double tap, Announcing .NET MAUI Preview 6\" width=\"1682\" height=\"1080\" \/><\/p>\n<p>In this example, when the weather widget tile is double-tapped, it simulates a refresh with a fade-out, fade-in animation.<\/p>\n<h2>Clipping<\/h2>\n<p>When you need to mask content you can now add shapes to the clipping region of a layout or view. The most common use for this is to make a circle image.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2021\/07\/circle-clipping.png\" alt=\"screen with circle image\" \/><\/p>\n<pre><code class=\"language-xaml\">&lt;Image Source=\"face.png\"&gt;\r\n    &lt;Image.Clip&gt;\r\n        &lt;EllipseGeometry RadiusX=\"80\"\r\n                         RadiusY=\"80\"\r\n                         Center=\"80,80\" \/&gt;\r\n    &lt;\/Image.Clip&gt;\r\n&lt;\/Image&gt;<\/code><\/pre>\n<h2>Native Alerts<\/h2>\n<p>Each platform has a native way of displaying alerts to users. These can be simple informational <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/pop-ups#display-an-alert\">popups<\/a>, <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/pop-ups#display-a-prompt\">simple input forms<\/a>, and even <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/pop-ups#guide-users-through-tasks\">action sheets<\/a> with multiple options to guide a user. These are available from any <code>Page<\/code> in a .NET MAUI application.<\/p>\n<pre><code class=\"language-csharp\">await DisplayAlert (\"Alert\", \"You have been alerted\", \"OK\");<\/code><\/pre>\n<p><a href=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2021\/07\/displayactionsheets.gif\"><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2021\/07\/displayactionsheets.gif\" alt=\"Image displayactionsheets\" width=\"550\" height=\"1080\" class=\"aligncenter size-full wp-image-33593\" \/><\/a><\/p>\n<p>These are just a few of the controls and layouts updated in preview 6. For a complete list, check out the commit log on GitHub. A few sweeping changes for layout, borders, corners, and shadows will be arriving in preview 7.<\/p>\n<h2>Single Project and Windows<\/h2>\n<p>We&#8217;ve made a few updates to single project based on developer feedback and Windows support to adopt the latest features. Some of you have been following along with each release, and we love that! Thank you for providing your feedback and engaging with us on GitHub and Discord. So, what has changed in preview 6 that you&#8217;ll need to update in your existing solutions?<\/p>\n<ul>\n<li>The NuGet package is replaced with the <a href=\"https:\/\/github.com\/dotnet\/maui\/blob\/release\/6.0.1xx-preview6\/src\/Templates\/src\/templates\/maui-mobile\/MauiApp1\/MauiApp1.csproj\">.NET MAUI workload<\/a> (<code>&lt;UseMaui&gt;true&lt;\/UseMaui&gt;<\/code> in the .csproj).<\/li>\n<li>Single project solutions now <a href=\"https:\/\/github.com\/dotnet\/maui\/tree\/release\/6.0.1xx-preview6\/src\/Templates\/src\/templates\/maui-mobile\/MauiApp1\/Platforms\">nest individual platforms<\/a> within a &#8220;Platforms&#8221; folder for tidy organization.<\/li>\n<li>Updated to Windows App SDK 0.8.1 RC. Use <a href=\"https:\/\/marketplace.visualstudio.com\/items?itemName=ProjectReunion.MicrosoftSingleProjectMSIXPackagingToolsDev17\" rel=\"noopener\" target=\"_blank\">the latest Visual Studio 2022 compatible extension<\/a> from the marketplace.<\/li>\n<\/ul>\n<p><img decoding=\"async\" class=\"alignnone\" src=\"https:\/\/devblogs.microsoft.com\/dotnet\/wp-content\/uploads\/sites\/10\/2021\/07\/platforms-folder.png\" alt=\"single project solution explorer, Announcing .NET MAUI Preview 6\" width=\"522\" height=\"394\" \/><\/p>\n<h2>Get Started Today<\/h2>\n<p>First thing&#8217;s first, install .NET 6 Preview 6. Now add the <code>maui<\/code> workload using the command above. Also make sure you have updated to the latest preview of Visual Studio 2022, or if you&#8217;re on macOS you can continue using CLI and your favorite code editor as we await the debut of Visual Studio for Mac 2022.  <\/p>\n<p>Ready? Create new app from the command line and then open the solution in Visual Studio 2022.<\/p>\n<pre><code class=\"language-cli\">dotnet new maui -n HelloPreview6<\/code><\/pre>\n<blockquote><p>In future versions of Visual Studio 2022 the .NET MAUI templates will appear in the File &gt; New list. Until then, the CLI is your good friend.<\/p><\/blockquote>\n<p>Xcode 13 Beta 1 is the new minimum requirement for iOS and macOS. For additional information about getting started with .NET MAUI, refer to our <a href=\"https:\/\/docs.microsoft.com\/dotnet\/maui\/get-started\/installation\">documentation<\/a>.<\/p>\n<h2>Feedback Welcome<\/h2>\n<p>Please let us know about your experiences using .NET MAUI Preview 6 to create new applications by engaging with us on GitHub at <a href=\"https:\/\/github.com\/dotnet\/maui\">dotnet\/maui<\/a>.<\/p>\n<p>For a look at what is coming in future releases, visit our <a href=\"https:\/\/github.com\/dotnet\/maui\/wiki\/roadmap\">product roadmap<\/a>.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>.NET MAUI Preview 6 is now available with workload installation, support for gesture recognizers, modals, alerts, and the latest release of Windows App SDK.<\/p>\n","protected":false},"author":553,"featured_media":33578,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[685,7233],"tags":[4,7238],"class_list":["post-33580","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-dotnet","category-maui","tag-net","tag-net-maui"],"acf":[],"blog_post_summary":"<p>.NET MAUI Preview 6 is now available with workload installation, support for gesture recognizers, modals, alerts, and the latest release of Windows App SDK.<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/33580","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\/553"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/comments?post=33580"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/posts\/33580\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media\/33578"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/media?parent=33580"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/categories?post=33580"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/dotnet\/wp-json\/wp\/v2\/tags?post=33580"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}