{"id":48037,"date":"2020-09-29T10:05:00","date_gmt":"2020-09-29T17:05:00","guid":{"rendered":"https:\/\/devblogs.microsoft.com\/xamarin\/?p=48037"},"modified":"2020-09-29T09:14:51","modified_gmt":"2020-09-29T16:14:51","slug":"xamarin-forms-5-preview","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/xamarin-forms-5-preview\/","title":{"rendered":"Xamarin.Forms 5 Preview: Advanced UI Controls for Beautiful Apps"},"content":{"rendered":"<p>Xamarin.Forms 5 brings to stable release features that you have seen in preview over the latest several 4.x releases. This includes solid and gradient <code>Brushes<\/code>, <code>CarouselView<\/code>, drag-and-drop, <code>RadioButton<\/code>, <code>Shapes<\/code>, and <code>SwipeView<\/code>. These new features inject new creative potential for your application designs to create beautiful, interactive experiences.<\/p>\n<p>Let&#8217;s look at those highlights, and then a quick checklist of what you should review as you get started with the Xamarin.Forms 5 pre-release.<\/p>\n<h2>Beautiful Design with Brushes, Shapes, and Paths<\/h2>\n<p>With brushes you can now easily paint gradients anywhere you need them. Shapes and paths allow you to draw all the rounded corners and even oddly shaped parts of your UI by using the platform graphics APIs which adds no size to your final applications. You can use geometries to clip any visual element, which makes it very easy to get the highly sought-after circle image.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/shapes-sxs.png\" alt=\"Image of two apps with custom shapes and gradients\" width=\"1873\" height=\"1946\" class=\"aligncenter size-full wp-image-48048\" srcset=\"https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/shapes-sxs.png 1873w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/shapes-sxs-289x300.png 289w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/shapes-sxs-986x1024.png 986w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/shapes-sxs-768x798.png 768w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/shapes-sxs-1478x1536.png 1478w\" sizes=\"(max-width: 1873px) 100vw, 1873px\" \/><\/p>\n<p>For more information, check out the <a href=\"https:\/\/docs.microsoft.com\/en-us\/xamarin\/xamarin-forms\/user-interface\/brushes?WT.mc_id=docs-blog-daortin\">brushes documentation<\/a>, <a href=\"https:\/\/docs.microsoft.com\/en-us\/xamarin\/xamarin-forms\/user-interface\/shapes?WT.mc_id=docs-blog-daortin\">shapes documentation<\/a>, <a href=\"https:\/\/devblogs.microsoft.com\/xamarin\/xamarin-forms-shapes-and-paths?WT.mc_id=docs-blog-daortin\">blog for shapes and paths<\/a>, and the <a href=\"https:\/\/devblogs.microsoft.com\/xamarin\/xamarinforms-4-8-gradients-brushes?WT.mc_id=docs-blog-daortin\">blog introducing brushes<\/a>.<\/p>\n<h2>Any UI with Templating<\/h2>\n<p>While <code>RadioButton<\/code> isn&#8217;t perhaps the most exciting form control, its use of control templating to radically alter the look of the design foreshadows where we can take control extensibility in future iterations. The <code>RadioButton<\/code> control now takes any content so you can completely control the look and behavior of the control. In its most simple usage, you can provide just text (left image), and in more advanced usage add a control template (right image) to match a <a href=\"https:\/\/developer.microsoft.com\/en-us\/fluentui#\/controls\/web\/choicegroup?WT.mc_id=docs-blog-daortin\">Fluent UI design<\/a>.<\/p>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/radios-sxs.png\" alt=\"Image of radio buttons in a classic style and templated with calendar views\" width=\"1785\" height=\"590\" class=\"aligncenter size-full wp-image-48045\" srcset=\"https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/radios-sxs.png 1785w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/radios-sxs-300x99.png 300w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/radios-sxs-1024x338.png 1024w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/radios-sxs-768x254.png 768w, https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/radios-sxs-1536x508.png 1536w\" sizes=\"(max-width: 1785px) 100vw, 1785px\" \/><\/p>\n<p><a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/app-fundamentals\/templates\/control-template?WT.mc_id=docs-blog-daortin\">Control templates<\/a> have actually been part of Xamarin.Forms since version 2. Broadening this capability beyond <a href=\"https:\/\/docs.microsoft.com\/dotnet\/api\/Xamarin.Forms.TemplatedView?WT.mc_id=docs-blog-daortin\">custom controls<\/a> to the provided native controls unlocks new potential.<\/p>\n<h2>More Interactive Controls with CarouselView, SwipeView, and Drag-and-drop<\/h2>\n<p><code>CarouselView<\/code> supports control of the looping, supports various visual states to transform the <code>CurrentItem<\/code>, <code>PreviousItem<\/code>, <code>NextItem<\/code>, and <code>DefaultItem<\/code> with VisualStateManager. <code>PeekAreaInsets<\/code> can be used to set how much of the previous and next items should encroach on the current item in view. It also includes an <code>EmptyView<\/code>, a property to attach an <code>IndicatorView<\/code>, and so much more. For details on how to use these features and others, visit the <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/carouselview?WT.mc_id=docs-blog-daortin\">CarouselView documentation<\/a>.<\/p>\n<p><center>\n  <div style=\"width: 297px;\" class=\"wp-video\"><video class=\"wp-video-shortcode\" id=\"video-48037-1\" width=\"297\" height=\"436\" preload=\"metadata\" controls=\"controls\"><source type=\"video\/mp4\" src=\"https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/carousel-loop.mp4?_=1\" \/><a href=\"https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/carousel-loop.mp4\">https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/carousel-loop.mp4<\/a><\/video><\/div>\n<\/center><\/p>\n<p><code>SwipeView<\/code> wraps any control and layout to add contextual buttons and commands like you might see in a list. <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/app-fundamentals\/gestures\/drag-and-drop?WT.mc_id=docs-blog-daortin\">Drag-and-drop gestures<\/a> allow you to add that gesture to any UI view and control what can accept the drop, whether inside the application, or outside. This is especially useful on the Surface Duo when you have two apps open.<\/p>\n<p><center>\n  <img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/xamarin\/wp-content\/uploads\/sites\/44\/2020\/09\/favfighters.gif\" alt=\"Phone with list of characters being swiped from the right.\" width=\"310\" height=\"622\" class=\"aligncenter size-full wp-image-48056\" \/>\n<\/center><\/p>\n<p>Learn more from the <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/swipeview?WT.mc_id=docs-blog-daortin\">SwipeView documentation<\/a>, <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/app-fundamentals\/gestures\/drag-and-drop?WT.mc_id=docs-blog-daortin\">drag-and-drop documentation<\/a>, <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/carouselview?WT.mc_id=docs-blog-daortin\">CarouselView documentation<\/a>, and from the <a href=\"https:\/\/devblogs.microsoft.com\/xamarin\/carouselview-xamarin-forms-4-3-prerelease?WT.mc_id=docs-blog-daortin\">CarouselView introduction blog post<\/a>.<\/p>\n<h2>Thank You Reviewers<\/h2>\n<p>This release also included several community reviewers that played a significant role in helping us get through so many bug fixes and enhancements for this release. Code contributors are always celebrated, and these community members have gone the additional step to help make sure those contributions make it more quickly into the product. Join us in celebrating these awesome individuals!<\/p>\n<ul>\n<li>Sia Ghassemi (<a href=\"https:\/\/twitter.com\/dersia_\">@dersia_<\/a>)<\/li>\n<li>Felipe Baltazar (<a href=\"https:\/\/github.com\/felipebaltazar\">@felipebaltazar<\/a>)<\/li>\n<li>Kangho Hur (<a href=\"https:\/\/github.com\/rookiejava\">@rookiejava<\/a>)<\/li>\n<li>Mohamed CHOUCHANE (<a href=\"https:\/\/github.com\/mohachouch\">@mohachouch<\/a>)<\/li>\n<li>Nick Randolph (<a href=\"https:\/\/github.com\/nickrandolph\">@nickrandolph<\/a>)<\/li>\n<li>Pedro Jesus (<a href=\"https:\/\/github.com\/pictos\">@pictos<\/a>)<\/li>\n<li>Rafael Rivera (<a href=\"https:\/\/github.com\/riverar\">@riverar<\/a>)<\/li>\n<li>Vladislav Antonyuk (<a href=\"https:\/\/github.com\/VladislavAntonyuk\">@VladislavAntonyuk<\/a>)<\/li>\n<\/ul>\n<p>Interested in participating? Join us on the .NET Discord in the <a href=\"https:\/\/discord.gg\/XtRRm4\">#xamarin-forms channel<\/a>.<\/p>\n<h2>Getting Ready for Xamarin.Forms 5<\/h2>\n<p>As you look at upgrading your applications to Xamarin.Forms 5, there are some changes and removals to be aware of first. For a complete list, <a href=\"https:\/\/docs.microsoft.com\/\/xamarin\/xamarin-forms\/release-notes\/5.0\/5.0.0-pre1?WT.mc_id=docs-blog-daortin\">review the release notes<\/a>. Most notably:<\/p>\n<ul>\n<li>Visual Studio 2019 is the minimum version to use<\/li>\n<li><code>MasterDetailPage<\/code> and properties have been renamed<\/li>\n<li><code>UIWebView<\/code> has been removed to address Apple restrictions<\/li>\n<li><code>MediaElement<\/code> and <code>Expander<\/code> have been moved to the <a href=\"https:\/\/github.com\/xamarin\/XamarinCommunityToolkit?WT.mc_id=docs-blog-daortin\">Xamarin Community Toolkit<\/a>. C# UI is to follow.<\/li>\n<li>(Preview) DataPages and Theme packages have been removed from the NuGet release<\/li>\n<\/ul>\n<p>For more details on these changes visit the <a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/release-notes\/5.0\/5.0.0-pre1#getting-ready-for-xamarinforms-5?WT.mc_id=docs-blog-daortin\">release notes<\/a>.<\/p>\n<p>Please take a few minutes to safely branch and upgrade your projects to this pre-release of Xamarin.Forms 5, and let us know what needs attention by <a href=\"https:\/\/github.com\/xamarin\/Xamarin.Forms\/issues\/new\/choose?WT.mc_id=docs-blog-daortin\">reporting an issue<\/a> on GitHub.<\/p>\n<p>Browse the awesome documentation for all of the great new features in Xamarin.Forms 5:<\/p>\n<ul>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/xamarin\/xamarin-forms\/user-interface\/brushes?WT.mc_id=docs-blog-daortin\">Brushes<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/carouselview?WT.mc_id=docs-blog-daortin\">CarouselView<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/app-fundamentals\/gestures\/drag-and-drop?WT.mc_id=docs-blog-daortin\">Drag-and-drop<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/indicatorview?WT.mc_id=docs-blog-daortin\">IndicatorView<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/xamarin\/Xamarin.Forms\/pull\/11628?WT.mc_id=docs-blog-daortin\">RadioButton<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/en-us\/xamarin\/xamarin-forms\/user-interface\/shapes?WT.mc_id=docs-blog-daortin\">Shapes and Paths<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/swipeview?WT.mc_id=docs-blog-daortin\">SwipeView<\/a><\/li>\n<li><a href=\"https:\/\/docs.microsoft.com\/xamarin\/xamarin-forms\/user-interface\/webview?tabs=windows#uiwebview-deprecation-and-app-store-rejection-itms-90809\">UIWebView<\/a><\/li>\n<\/ul>\n","protected":false},"excerpt":{"rendered":"<p>Xamarin.Forms 5 brings to stable release features that you have seen in preview over the latest several 4.x releases. This includes solid and gradient Brushes, CarouselView, drag-and-drop, RadioButton, Shapes, and SwipeView. These new features inject new creative potential for your application designs to create beautiful, interactive experiences. Let&#8217;s look at those highlights, and then a [&hellip;]<\/p>\n","protected":false},"author":553,"featured_media":48048,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2,1,367],"tags":[750,9169,8152,9022,6603,9021,27,16,9168],"class_list":["post-48037","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","category-xamarin","category-xamarin-forms","tag-carouselview","tag-control-templating","tag-gradients","tag-paths","tag-preview","tag-shapes","tag-xamarin","tag-xamarin-forms","tag-xamarin-forms-5"],"acf":[],"blog_post_summary":"<p>Xamarin.Forms 5 brings to stable release features that you have seen in preview over the latest several 4.x releases. This includes solid and gradient Brushes, CarouselView, drag-and-drop, RadioButton, Shapes, and SwipeView. These new features inject new creative potential for your application designs to create beautiful, interactive experiences. Let&#8217;s look at those highlights, and then a [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/48037","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/users\/553"}],"replies":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/comments?post=48037"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/48037\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/48048"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=48037"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=48037"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=48037"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}