Xamarin.Forms 4.0.0.346134-pre9 (4.0.0 Pre Release 9) Release Notes

Getting Started | What's New | Known Issues | Breaking Changes | API Changes | Blogs | Feedback | Open Source

Xamarin.Forms 4.0.0 is a substantial release with several big new features. As such, we are releasing much earlier than usual to get more feedback not only on the quality of the release, but on the use of the features while we are still developing them.

To get started with Xamarin.Forms 4.0 enable all the new features in your MainActivity.cs and AppDelegate.cs via the feature flags api:

global::Xamarin.Forms.Forms.SetFlags("Shell_Experimental", "CollectionView_Experimental");
global::Xamarin.Forms.Forms.Init(this, savedInstanceState);

Here's what you have to look forward to:

Shell

Shell introduces a simplified way to express the structure and navigation for your application in a single file. No more dealing with different page types to handle setting up complicated navigation. It supports flyout menu, bottom tabs, top tabs, and an integrated search handler. A new URI based navigation routing system has been implemented in addition to the existing push/pop navigation service. Now you can route to any point in your application, no matter how deep, and handle navigation events to perform custom logic such as canceling the back action.

To get started, add a new ContentPage with XAML to your project and modify the code below to match your namespace:

<?xml version="1.0" encoding="UTF-8"?>
<Shell xmlns="http://xamarin.com/schemas/2014/forms" 
       xmlns:x="http://schemas.microsoft.com/winfx/2009/xaml" 
       xmlns:local="clr-namespace:NewApp"
       RouteHost="companyname.com"
       RouteScheme="app"
       Route="NewApp"
       FlyoutBehavior="Disabled"
       Title="NewApp"
       x:Class="NewApp.AppShell">

    <!-- 
        Styles and Resources 
    -->
    <Shell.Resources>
        <ResourceDictionary>
            <Color x:Key="NavigationPrimary">#2196F3</Color>
            <Style x:Key="BaseStyle" TargetType="Element">
                <Setter Property="Shell.ShellBackgroundColor" Value="{StaticResource NavigationPrimary}" />
                <Setter Property="Shell.ShellForegroundColor" Value="White" />
                <Setter Property="Shell.ShellTitleColor" Value="White" />
                <Setter Property="Shell.ShellDisabledColor" Value="#B4FFFFFF" />
                <Setter Property="Shell.ShellUnselectedColor" Value="#95FFFFFF" />
                <Setter Property="Shell.ShellTabBarBackgroundColor" Value="{StaticResource NavigationPrimary}" />
                <Setter Property="Shell.ShellTabBarForegroundColor" Value="White"/>
                <Setter Property="Shell.ShellTabBarUnselectedColor" Value="#95FFFFFF"/>
                <Setter Property="Shell.ShellTabBarTitleColor" Value="White"/>
            </Style>
            <Style TargetType="ShellItem" BasedOn="{StaticResource BaseStyle}" />
        </ResourceDictionary>
    </Shell.Resources>

    <!-- Your Pages -->
    <ShellItem>
        <ShellContent>
            <local:MainPage/>
        </ShellContent>
    </ShellItem>

</Shell>

Then set this AppShell class as your main page in the App.xaml.cs file:

namespace NewApp
{
    public partial class App : Application
    {
        public App ()
        {
            InitializeComponent();

            MainPage = new AppShell();
        }
    }
}

For more information about Shell check out the preview doc and view the Tailwind Traders mobile reference app. If you're evaluating Visual Studio 2019 on Windows, we've created a set of Shell templates for you. Download and install the package here.

CollectionView and CarouselView

CollectionView is the flexible and performant list control that you've been asking for. It can handle horizontal, vertical, and grid layouts out of the box, and you can provide custom layouts as well. CollectionView is also the foundation for CarouselView.

For more information about CollectionView, check out the preview doc.

Tip

There are lots of new features planned for Xamarin.Forms 4.0 -- check out what's new below.

What's New in this Release

  • Github #1661 - "[Enhancement] Android: WebView - Control over Zoom controls" (#3607) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • Github #2789 - "Improved A11y Support - TabIndex" (#3989) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #3478 - "Allow TintColor and UnselectedItemTintColor as platform-specifics" (#4899) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • Github #5015 - "[Enhancement] BindableObject perf improvements" (#5324) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • Github #5310 - "Ability to hide HomeIndicator from iPhone X, XR, XS on given page" (#5717) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5790 - "[Shell] Uri Navigation Spec when using GoToAsync" (#5852) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))

Notable Changes

Visual

  • "Centralize Theme Wrapper and fix sandbox to work with previewer" (#5495) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #5822 - "editor placeholder issue" (#5823) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))

F100s

  • Github #1661 - "[Enhancement] Android: WebView - Control over Zoom controls" (#3607) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))

Features in Preview

Shell

  • "[Shell] Rename ShellItem" (#5624) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • "Add AllowMultiple=true to QueryPropertyAttribute" (#5180) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • "ContextCompat.getColor if API < 23" (#5450) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • "Rename currentshell" (#5761) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #3124 - "[Shell] 3bar.png missing for the flyout menu hamburger" (#5567) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #4684 - "Xamarin 4.0.0.8055-pre1 Shell Crashes when navigating too quickly" (#5671) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #4758 - "[Shell] Tabs came back" (#5896) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #4766 - "[Shell] Cannot set hamburger button asset" (#5567) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #4769 - "[Shell] URI based navigation missing methods" (#5852) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5466 - "[Shell] Cannot navigate to a route" (#5564) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #5504 - "[Shell] DisplayAlert crashes" (#5491) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #5705 - "[Shell] SearchHandler BindingContext not inherited from page" (#5730) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5706 - "[Shell] SearchHandler.Query property value isn't passed via CommandParameter" (#5776) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5712 - "[Shell]SearchHandler should include SelectedItem property" (#5775) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5734 - "[Shell] BackButtonBehavior BindingContext not inherited from page" (#5743) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))

CollectionView

  • "[CollectionView] Fixes for ObservableCollection usage on Android and iOS" (#4664) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • "[iOS] Fix crash when going from empty to having items" (#5430) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • "CollectionView MultiSelect iOS/Android" (#5352) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #4826 - "[Enhancement] Make CollectionView ItemTemplate work with DataTemplateSelector" (#5429) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #5535 - "CollectionView: Swapping EmptyViews has no effect" (#5720) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))

Release History

  • Wednesday, April 17, 2019 - Xamarin.Forms 4.0.0.346134-pre9 (4.0.0 Pre Release 9)
  • Wednesday, April 3, 2019 - Xamarin.Forms 4.0.0.304370-pre8 (4.0.0 Pre Release 8)
  • Wednesday, March 20, 2019 - Xamarin.Forms 4.0.0.250467-pre7 (4.0.0 Pre Release 7)
  • Wednesday, March 13, 2019 - Xamarin.Forms 4.0.0.232914-pre6 (4.0.0 Pre Release 6)
  • Wednesday, February 20, 2019 - Xamarin.Forms 4.0.0.169046-pre5 (4.0.0 Pre Release 5)
  • Wednesday, February 6, 2019 - Xamarin.Forms 4.0.0.135214-pre4 (4.0.0 Pre Release 4)
  • Wednesday, January 23, 2019 - Xamarin.Forms 4.0.0.94569-pre3 (4.0.0 Pre Release 3)
  • Thursday, January 10, 2019 - Xamarin.Forms 4.0.0.62955-pre2 (4.0.0 Pre Release 2)
  • Monday, December 3, 2018 - Xamarin.Forms 4.0.0.8055-pre1 (4.0.0 Pre Release 1)

Wednesday, April 17, 2019 - Xamarin.Forms 4.0.0.346134-pre9 (4.0.0 Pre Release 9)

Issues Fixed

Additional fixes included in this release

  • "[iOS] Fix usage of iOS11 api" (#5893)
  • "[Shell] Hide Shell types from being browsable" (#5915)
  • "Add explicit references back into nuspec" (#5902)
  • "XamlLoader should not ignore x:TypeArguments on root node" (#5804)

Wednesday, April 3, 2019 - Xamarin.Forms 4.0.0.304370-pre8 (4.0.0 Pre Release 8)

Issues Fixed

Additional fixes included in this release

  • "[CollectionView] Fixes for ObservableCollection usage on Android and iOS" (#4664)
  • "[iOS] Fix crash when going from empty to having items" (#5430)
  • "[XamlC] Resolve complex property type" (#5086)
  • "Add covariance back to IElementConfiguration" (#5771)
  • "Add translated Intellisense files to NuGet package" (#5672)
  • "Centralize Theme Wrapper and fix sandbox to work with previewer" (#5495)
  • "Correctly load addresses of intermediate values in compiled binding paths" (#5082)
  • "Re-enable "Treat warnings as errors"" (#5602)
  • "remove covariant out on IElementConfiguration" (#5449)
  • "Rename currentshell" (#5761)
  • "Shell throws an exception when updating the padding insets" (#5757)

Wednesday, March 20, 2019 - Xamarin.Forms 4.0.0.250467-pre7 (4.0.0 Pre Release 7)

Issues Fixed

Wednesday, March 13, 2019 - Xamarin.Forms 4.0.0.232914-pre6 (4.0.0 Pre Release 6)

Issues Fixed

Additional fixes included in this release

  • "[iOS] Fix ImageRenderer dispose" (#5222)
  • "[macOS] Only the first Navigating event of WebView can be triggered" (#4737)
  • "[UWP] Roll back PR 3400 so the correct context is passed into Tapped" (#5476)
  • "Add AllowMultiple=true to QueryPropertyAttribute" (#5180)
  • "BindableProperty: More explanatory exception message" (#5384)
  • "ContextCompat.getColor if API < 23" (#5450)
  • "Revert "Add AllowMultiple=true to QueryPropertyAttribute"" (#5234)
  • "Updated all the OpenTK references to use NuGet" (#4836)

Wednesday, February 20, 2019 - Xamarin.Forms 4.0.0.169046-pre5 (4.0.0 Pre Release 5)

See Xamarin.Forms 3.6!

Wednesday, February 6, 2019 - Xamarin.Forms 4.0.0.135214-pre4 (4.0.0 Pre Release 4)

See Xamarin.Forms 3.6!

Wednesday, January 23, 2019 - Xamarin.Forms 4.0.0.94569-pre3 (4.0.0 Pre Release 3)

See Xamarin.Forms 3.5!

Thursday, January 10, 2019 - Xamarin.Forms 4.0.0.62955-pre2 (4.0.0 Pre Release 2)

See Xamarin.Forms 3.5!

Monday, December 3, 2018 - Xamarin.Forms 4.0.0.8055-pre1 (4.0.0 Pre Release 1)

See Xamarin.Forms 3.5!

Known Issues

  • Github #5940 - "[Bug] Shell treats Show/Hide Flyout Differently from TabBar and NavBar"
  • Github #5831 - "[iOS] Layout and Styling Issues when reloading page"
  • Github #5766 - "[Android / Fast Renderer] Frame size gets corrupted when ListView is scrolled"
  • Github #5501 - "Binding on Shell.FlyoutHeaderTemplate not work"
  • Github #5465 - "[UWP] Issue2927 failing and Tapped is passing the wrong value in for Item"
  • Github #5382 - "The Xamarin.Forms.CarouselView crashes inside a ListView in iOS only"
  • Github #5336 - "Effect that changes Label's background does not work when the FastRenderers flag is set"
  • Github #5132 - "Unable to specify automation properties on the hamburger / flyout icon"
  • Github #5131 - "Unable to set tab or focus order on Shell flyout menu items"
  • Github #4946 - "Tests in Issue3624 fails"
  • Github #4872 - "[Shell] CSS is not working when referencing CSS-file in App.xaml"
  • Github #4856 - "App Crashes on nested Shell section"
  • Github #4762 - "[Shell] DisplayActionSheet "
  • Github #4755 - "[Shell] Control loses focus after appearing"
  • Github #4399 - "[Shell] MenuItems outside of collection render differently"
  • Github #3875 - "[Shell] Flyout menu items should start below my header, no matter how tall"
  • Github #3543 - "[Android] Can't Overlap a Button with any view"
  • Github #3125 - "[Shell] Search bar on iOS is dark and black text is illegible"
  • Github #3124 - "[Shell] 3bar.png missing for the flyout menu hamburger"
  • Github #2989 - "[Android] Fast Renderers are not visually dealing with moving views around in the visual stack correctly"

Breaking Changes

  • "Rename currentshell" (#5761) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))

Namespace Xamarin.Forms

Type Changed: Xamarin.Forms.IShellItemController

Removed method:

-public virtual System.Threading.Tasks.Task GoToPart (System.Collections.Generic.List<string> parts, System.Collections.Generic.Dictionary<System.String,System.String> queryData);

Type Changed: Xamarin.Forms.IShellSectionController

Removed method:

-public virtual System.Threading.Tasks.Task GoToPart (System.Collections.Generic.List<string> parts, System.Collections.Generic.Dictionary<System.String,System.String> queryData);

Type Changed: Xamarin.Forms.Shell

Removed property:

-public static Shell CurrentShell { get; }

Type Changed: Xamarin.Forms.VisualElement

Removed properties:

-public Style Style { get; set; }
-public System.Collections.Generic.IList<string> StyleClass { get; set; }
-public System.Collections.Generic.IList<string> class { get; set; }

Namespace Xamarin.Forms.Platform.Android

Type Changed: Xamarin.Forms.Platform.Android.EmptyViewAdapter

Removed constructor:

-public EmptyViewAdapter ();
Assembly Version Changed: 2.0.0.0 vs 0.0.0.0

Deprecations

  • Github #3478 - "Allow TintColor and UnselectedItemTintColor as platform-specifics" (#4899) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • Github #5015 - "[Enhancement] BindableObject perf improvements" (#5324) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))

API Changes

See all API Changes here.

  • "Rename currentshell" (#5761) (added in 4.0.0.304370-pre8 (4.0.0 Pre Release 8))
  • Github #1661 - "[Enhancement] Android: WebView - Control over Zoom controls" (#3607) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • Github #2789 - "Improved A11y Support - TabIndex" (#3989) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #3478 - "Allow TintColor and UnselectedItemTintColor as platform-specifics" (#4899) (added in 4.0.0.232914-pre6 (4.0.0 Pre Release 6))
  • Github #4769 - "[Shell] URI based navigation missing methods" (#5852) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5310 - "Ability to hide HomeIndicator from iPhone X, XR, XS on given page" (#5717) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5520 - "Cannot create a Behavior for BindableObject" (#5559) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))
  • Github #5712 - "[Shell]SearchHandler should include SelectedItem property" (#5775) (added in 4.0.0.346134-pre9 (4.0.0 Pre Release 9))

Blogs

blog.xamarin.com

Feedback

Your feedback is important to us. If there are any problems with this release, check the Xamarin.Forms Forums and GitHub for existing issues. Report new issues and suggestions on GitHub.

Open Source

Xamarin.Forms 4.0.0 is based on the open-source Xamarin.Forms repository: