{"id":36227,"date":"2018-03-30T15:02:00","date_gmt":"2018-03-30T19:02:00","guid":{"rendered":"https:\/\/blog.xamarin.com\/?p=36227"},"modified":"2018-03-30T15:02:00","modified_gmt":"2018-03-30T19:02:00","slug":"update-to-xamarin-forms-3-0-pre-release-available-today","status":"publish","type":"post","link":"https:\/\/devblogs.microsoft.com\/xamarin\/update-to-xamarin-forms-3-0-pre-release-available-today\/","title":{"rendered":"Update to Xamarin.Forms 3.0 Pre-Release Available Today!"},"content":{"rendered":"<p>\t\t\t\tWe&#8217;re excited to announce that the latest <a href=\"https:\/\/www.nuget.org\/packages\/Xamarin.Forms\/3.0.0.296286-pre2\">update to the Xamarin.Forms 3.0 Pre-release<\/a> is now available! Help us make this our best Xamarin.Forms release ever by updating today and giving it a try. Here&#8217;s the breakdown of what you can expect in this release.<\/p>\n<h2>Overview<\/h2>\n<p>Xamarin.Forms 3.0 delivers stability, performance, and features focusing on making it easier to create beautiful applications that work on a variety of devices. We&#8217;re now building with .NET Standard 2.0, using the magic of multi-targeting, while still supporting the PCL profiles and other .NET Standard versions you may need. Notice how much faster your projects load when you use .NET Standard project types!<\/p>\n<p>We&#8217;ve gained some performance in our never-ending pursuit of faster builds, instant cold starts, and runtime speed. Xamarin.Forms 3.0 opens up more functionality, includes some great community contributions, and even sheds a little overhead as we sunset Windows Phone and WinRT. For the best Windows experience, you\u2019ll want to use <strong>UWP<\/strong>. Our incredible community has taken up the challenge of older versions of Windows, and Xamarin.Forms 3.0 now includes the early preview of WPF support.<\/p>\n<h2>Feature Highlights<\/h2>\n<p>Based on community surveys, looking at your apps, and many one-on-one conversations with developers, we know that a significant number of you come to Xamarin.Forms from other mobile and desktop XAML experiences. We want to make your experience as productive as possible while using the parts you\u2019re already familiar with. This continues in 3.0 with the introduction of the <a href=\"#visual-state-manager\">Visual State Manager<\/a>.<\/p>\n<blockquote style=\"background-color:#f1f1f1;text-align: left;font-size: medium;padding: 10px 20px;border-left: 3px solid #39e\">\n<p style=\"font-size:15px\">&#8220;Share your experiences with us! Your feedback matters, and we need to hear from you. If you have a story to share, whether to celebrate your success or to show us where you&#8217;d like us to improve, send me an email.&#8221;<\/p>\n<p style=\"font-size:15px\"><b>&#8211; Dave<\/b><br \/>\nSenior Program Manager, Xamarin.Forms<br \/>\n<a href=\"mailto:david.ortinau@microsoft.com\">david.ortinau@microsoft.com<\/a><\/p>\n<\/blockquote>\n<p>There are a significant number of mostly ASP.NET and web developers using Xamarin.Forms today with little-to-no desktop experience. In light of that finding, and after looking at how web developers are productive in their own workflows, we&#8217;ve identified two features to add to Xamarin.Forms: <a href=\"#flex-layout\">FlexLayout<\/a> and <a href=\"#stylesheets\">CSS<\/a>. Xamarin.Forms 3.0 introduces both of these features without compromising the existing XAML experience desktop developers have come to know and love.<\/p>\n<p>To add to that, <a href=\"#right-to-left\">Right-to-Left<\/a> support and a ton of quality improvements have also been included in this 3.0 release! Let\u2019s explore a quick overview of each feature mentioned.\n<a name=\"visual-state-manager\"><\/a><\/p>\n<h3>Visual State Manager<\/h3>\n<p>XAML developers using UWP have been productive managing the state of their controls by using a <code>VisualStateManager<\/code>. Common use cases are to set the valid or invalid state of form controls, when something is enabled or disabled, or even move a control through multiple states, such as a password strength indicator. For more examples of this in action, check out the <a href=\"https:\/\/github.com\/davidortinau\/flexibility\/blob\/master\/Flexibility.Shared\/LoginPage.xaml\">login page of this sample app<\/a>.<\/p>\n<blockquote style=\"background-color:#f1f1f1;text-align: left;font-size: medium;padding: 10px 20px;border-left: 3px solid #39e\">\n<p style=\"font-size:15px\">Note: This is the first iteration of <code>VisualStateManager<\/code> in Xamarin.Forms 3.0. We&#8217;re considering how to make this more useful to you in future iterations. Please send us your thoughts.<\/p>\n<\/blockquote>\n<p><a name=\"flex-layout\"><\/a><\/p>\n<h3>FlexLayout: Distribution and Adaptability<\/h3>\n<p>Inspired by the popular\u00a0<code>FlexBox<\/code>, <code>FlexLayout<\/code> introduces a new layout for Xamarin.Forms. <code>FlexLayout<\/code> gives you superior control over how children are distributed and how your layouts adapt to various sizes and dimensions. This layout also promotes a flatter UI hierarchy, a best practice for creating performant interfaces.<\/p>\n<p>Since the introduction of <a href=\"#stylesheets\">basic CSS support<\/a>, you can now grab web-based CSS snippets for <code>FlexBox<\/code> in your Xamarin.Forms apps with little-to-no adjustment.<\/p>\n<p><img decoding=\"async\" class=\"alignright size-full wp-image-36269\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/flexlayout.jpg\" alt=\"\" width=\"1024\" height=\"768\" \/><\/p>\n<p>For examples of the types of layouts you might create with FlexLayout, and how to implement them, explore this <a href=\"https:\/\/github.com\/davidortinau\/flexibility\">sample app on GitHub<\/a>, as well as our <code>FlexLayout<\/code> <a href=\"https:\/\/github.com\/xamarin\/\/pull\/1759\">pull request<\/a>, which describes the properties available to you.<\/p>\n<p><a name=\"stylesheets\"><\/a><\/p>\n<h3>StyleSheets: The Power of CSS in Your Apps<\/h3>\n<p>Xamarin.Forms developers have long been productive expressing Styles via XAML, and this remains unchanged. In 3.0, CSS introduces a complimentary way to express Styles together with XAML Styles and, in some cases, all by itself. For a list of the Style properties available in StyleSheets, check out the <a href=\"https:\/\/github.com\/xamarin\/\/pull\/1207\">pull request<\/a>.<\/p>\n<p>StyleSheets can be added to your XAML by loading a separate <code>*.css<\/code> file or inline.<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;ContentPage x:Class=\"...\"&gt;\n  &lt;ContentPage.Resources&gt;\n    &lt;StyleSheet Source=\"appresources\/style.css\" \/&gt;\n  &lt;\/ContentPage.Resources&gt;\n&lt;\/ContentPage&gt;<\/pre>\n<p>Notice the nice, collapsed <code>ResourceDictionary<\/code> syntax. We teased this as a &#8220;coming soon&#8221; enhancement in the previous post <a href=\"https:\/\/blog.xamarin.com\/better-resource-organization-xamarin-forms\/\">Better Resource Organization<\/a>. Be sure to check that out.<\/p>\n<pre class=\"lang:xhtml decode:true \">&lt;ContentPage x:Class=\"...\"&gt;\n  &lt;ContentPage.Resources&gt;\n    &lt;StyleSheet&gt;\n&lt;![CDATA[\n^contentpage {\n    background-color: orange;\n    padding: 20;\n}\n\nstacklayout &gt; * {\n    margin: 3;\n}\n]]&gt;\n    &lt;\/StyleSheet&gt;\n  &lt;\/ContentPage.Resources&gt;\n&lt;\/ContentPage&gt;<\/pre>\n<p>Several of <a href=\"https:\/\/github.com\/davidortinau\/flexibility\">these example layouts<\/a> demonstrate various ways to express styles. <\/p>\n<p><a name=\"right-to-left\"><\/a><\/p>\n<h3>Right-To-Left Localization<\/h3>\n<p><img decoding=\"async\" src=\"https:\/\/devblogs.microsoft.com\/wp-content\/uploads\/sites\/44\/2019\/03\/2018-03-30_11-20-20.gif\" alt=\"\" width=\"235\" class=\"alignright size-full wp-image-36289\" \/><\/a>\nWhile it&#8217;s always been possible to support right-to-left scripts in Xamarin.Forms (using effects, custom layouts, and custom renderers), it hasn&#8217;t always been as easy as it should be. To that end, we&#8217;ve now surfaced the necessary API to easily read and use the user&#8217;s regional settings, as well as updated our layouts and controls to respect those settings. It&#8217;s really as simple as doing the following in your XAML for layouts and controls:<\/p>\n<p><code>FlowDirection=\"{Binding Device.FlowDirection}\"\n<\/code><\/p>\n<h3>New Platform Previews<\/h3>\n<p>This version of Xamarin.Forms ships with new and updated platform previews, including Tizen, GTK#, macOS, and WPF. A huge thanks to our community and partners for these incredible contributions!<\/p>\n<p>Each of these are in varying stages of maturity, so check the <a href=\"https:\/\/github.com\/xamarin\/\/wiki\/Platform-Support\">platform support page<\/a> on our wiki for details.<\/p>\n<h2>Begin exploring today!<\/h2>\n<p>Check out the <a href=\"https:\/\/developer.xamarin.com\/releases\/xamarin-forms\/xamarin-forms-3.0\/3.0.0-pre2\/\">release notes<\/a> for a rundown of the full list of enhancements and fixes. Xamarin.Forms 3.0 pre-release is <a href=\"https:\/\/www.nuget.org\/packages\/Xamarin.Forms\/3.0.0.296286-pre2\">on NuGet now<\/a>. To update, check for pre-release options in your NuGet manager and add the package to all of your solutions projects. Reboot the IDE for a clean start, and get going!<\/p>\n<p>If you\u2019re upgrading from an older version of Xamarin.Forms, check that your Android project is using target framework 7.0 or greater and Android Support Libraries 25 or newer. For additional details on resolving your Android dependencies, refer to the <a href=\"https:\/\/developer.xamarin.com\/releases\/xamarin-forms\/xamarin-forms-2.5\/2.5.0-stable\/\" rel=\"noopener\" target=\"_blank\">2.5.0 stable release notes<\/a>.<\/p>\n<p>Please <a href=\"https:\/\/github.com\/xamarin\/\/issues\/new\">file any issues<\/a> you discover for us to troubleshoot and address.\t\t<\/p>\n","protected":false},"excerpt":{"rendered":"<p>We&#8217;re excited to announce that the latest update to the Xamarin.Forms 3.0 Pre-release is now available! Help us make this our best Xamarin.Forms release ever by updating today and giving it a try. Here&#8217;s the breakdown of what you can expect in this release. Overview Xamarin.Forms 3.0 delivers stability, performance, and features focusing on making [&hellip;]<\/p>\n","protected":false},"author":553,"featured_media":39167,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_acf_changed":false,"footnotes":""},"categories":[2],"tags":[16],"class_list":["post-36227","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-developers","tag-xamarin-forms"],"acf":[],"blog_post_summary":"<p>We&#8217;re excited to announce that the latest update to the Xamarin.Forms 3.0 Pre-release is now available! Help us make this our best Xamarin.Forms release ever by updating today and giving it a try. Here&#8217;s the breakdown of what you can expect in this release. Overview Xamarin.Forms 3.0 delivers stability, performance, and features focusing on making [&hellip;]<\/p>\n","_links":{"self":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/36227","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=36227"}],"version-history":[{"count":0,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/posts\/36227\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media\/39167"}],"wp:attachment":[{"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/media?parent=36227"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/categories?post=36227"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/devblogs.microsoft.com\/xamarin\/wp-json\/wp\/v2\/tags?post=36227"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}