Xamarin.Forms 4.0.0.94569-pre3 (4.0.0 Pre Release 3) Release Notes

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

What's New in this Release

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.

While we work on 4.0.0, we will continue releasing quality improvements and minor enhancements via the 3.x series approximately every 6 weeks.

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", "Visual_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.

Visual

Visual is a new way to achieve consistent UI design across iOS and Android, beginning with an implementation of Google's Material Design. This first iteration include Button, Entry, Frame, and ProgressBar. Visual goes beyond styles to also unify behavior and when necessary providing highly customize renderers.

Xamarin.Forms Visual on Android and iOS

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

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.

And much more!

  • " Implemented colored refresh indicator for ListView pull-to-refresh" (#2961)
  • "[Enhancement] Add CollectionView progress behind feature flag" (#4265)
  • "[Enhancement] Add Visual progress behind feature flag " (#4449)
  • "[GTK] Do not show a label in gtk slider renderer" (#4098)
  • "[GTK] Fix synchronization context fairness" (#4237)
  • "[Tizen] Fix Window alpha update timing" (#4119)
  • "[Xaml] Support correctly custom resource providers" (#4236)
  • "[XamlC] Always enable implicit casting and boxing and unboxing" (#4238) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • "[XamlC] Resolve generic parameters of a method with generic return type" (#4244) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • "[XamlC] Resolve parameters in nested generics" (#4061)
  • "Implementation of method ForceUpdateSize for Cell on macOS" (#4104)
  • "Move GetNativeSize to PlatformServices, remove IPlatform" (#4235)
  • "Remove unnecessary ToArray to reduce number of BindableObject[] allocations" (#4101)
  • "XAML Previewer - Support for inline design data via mc:ignorable" (#4743) (#4781) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #1718 - "[Enhancement] Bindable Repeater control" (#4052)
  • Github #1724 - "[Enhancement] ImageButton on Tizen" (#4436)
  • Github #1742/Bugzilla 52656 - "[Enhancement] ToolbarItem A11y" (#3974)
  • Github #1788 - "[Enhancement] Seal public attributes " (#4559)
  • Github #2057 - "[UWP] Enable dynamic overflow on ToolbarItems" (#4022)
  • Github #2691 - "Make XmlnsDefinitionAttribute Public" (#2782)
  • Github #2910 - "[Enhancement] Ability to set TextColor on TableSection" (#4379)
  • Github #3555 - "[Enhancement] Editor: Control over text-prediction " (#4023)
  • Github #3843 - "[Enhancement] Hide Scroll Bars on ListView" (#3897)
  • Github #3988 - "[UWP] Expose platform specific to set IsDynamicOverflowEnabled on the CommandBar" (#4022)
  • Github #4027 - "Adding OnColor property for SwitchCell" (#4036)
  • Github #4083 - "[Enhancement] remove sealed from Span" (#4331)
  • Github #4470 - "ImageButton and CSS" (#4482)
  • Github #4629 - "Picker/DatePicker/TimePicker on iOS iPad should NOT have word suggestions" (#4824) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))

Notable Changes

Features in Preview

Shell

  • "[Android] If drawable specified on shell doesn't exist don't dispose of it" (#4904) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "[Shell] allow missing trailing slash on uri" (#4595)
  • "[Shell][iOS] do not try to smartly unblend bgcolor" (#4593) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #2415 - "Xamarin.Forms.Shell Spec" (#4522)
  • Github #4382 - "[Shell] Crash when switching Bottom Navigation Tabs too fast" (#4617) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4592 - "[Shell] compile the DataTemplateExtension" (#4641) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4596 - "[Shell] queryParams in navigation not handled" (#4615)
  • Github #4603 - "[Shell] Shell push/pop Navigation broken" (#4604)
  • Github #4625 - "[Shell] statically expose the current shell" (#4626) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4837 - "[Shell] Cannot pass querystring value to registered route" (#4843) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4971 - "[Shell] Cannot navigate to a relative URI" (#4977) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))

CollectionView

  • "[Core] Fix check for CollectionView flag" (#4471)
  • "CollectionView Android Single Item Selection" (#4651) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • "CollectionView iOS EmptyViewTemplate" (#4870) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "CollectionView iOS Move Item" (#4863) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "CollectionView iOS Replace Item" (#4865) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • "CollectionView SnapPointsAlignment/SnapPointsType" (#4414) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))
  • Github #3172 - "Xamarin.Forms.CollectionView Spec" (#4265)
  • Github #4366 - "[CollectionView] Failure to set ItemsSource causes an unhandled exception to occur" (#4536)
  • Github #4406 - "[CollectionView, Android] Items using a Grid in their template do not fill the screen's width" (#4569) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4474 - "[iOS] Number of items not updating with Collection View Control Gallery tests" (#4535)
  • Github #4600 - "[iOS] CollectionView crash with empty ObservableCollection" (#4688) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))

Visual

Release History

  • 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, January 23, 2019 - Xamarin.Forms 4.0.0.94569-pre3 (4.0.0 Pre Release 3)

Issues Fixed

  • Github #2818 - "[Android] Right-to-Left MasterDetail in Xamarin.Forms v3 Hamburger icon issue" (#3992) (#4716)
  • Github #4957 - "[iOS] Issue3652 - items readded to iOS ListView after they were removed aren't visible" (#4968)
  • Github #4971 - "[Shell] Cannot navigate to a relative URI" (#4977)

Additional fixes included in this release

  • "[Android] Allow the page background to be reset" (#4916)
  • "[Android] If drawable specified on shell doesn't exist don't dispose of it" (#4904)
  • "[iOS] Fix unsubscribing the PropertyChanged event of the ViewCell" (#4728)

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

Issues Fixed

  • Github #2663 - "FlexLayout incorrectly applies padding" (#4823)
  • Github #4102 - "x:DataType issue when there is a null object in binding path." (#4521)
  • Github #4382 - "[Shell] Crash when switching Bottom Navigation Tabs too fast" (#4617)
  • Github #4406 - "[CollectionView, Android] Items using a Grid in their template do not fill the screen's width" (#4569)
  • Github #4553 - "[Feedback] BindingError (Type Binding not found in xmlns)" (#4582)
  • Github #4600 - "[iOS] CollectionView crash with empty ObservableCollection" (#4688)
  • Github #4738 - "Metadata missing for Intellisense for constructor parameters" (#4846)
  • Github #4751 - "XAML Error message too vague: Error: The given key 'Xamarin.Forms.Xaml.ElementNode' was not present in the dictionary. " (#4786)
  • Github #4760 - "Generic base class for XAML markup extensions" (#4776)
  • Github #4782 - "[Android] 3rd party libraries that set the ImageButton drawable to null will cause ImageButtonRenderer to crash" (#4783)
  • Github #4789 - "[Android] No method with name='setClipBounds' crash in ImageElementManager" (#4794) (#4819) (#4954)
  • Github #4790 - "[Android] No method with name='setClipBounds' crash in ItemsViewRenderer" (#4794) (#4819) (#4954)
  • Github #4837 - "[Shell] Cannot pass querystring value to registered route" (#4843)

Additional fixes included in this release

  • "[Android] Avoid acting on a disposed reference" (#4780)
  • "[Shell][iOS] do not try to smartly unblend bgcolor" (#4593)
  • "Properly detect SDK style projects" (#4699)
  • Github #4620 - "XamlC Perf investigation" (#4624)

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

Issues Fixed

  • Github #1399 - "ActivityIndicator width is autosize in absolutelayout is -1/0 on windows" (#3224)
  • Github #1480 - "[iOS] WebTryThreadLock error on WebView with TranslateTo" (#4160)
  • Github #2223 - "Entry's IsPassword property , when changed programmatically is not masking/unmasking text in the screen in Mac app " (#4175)
  • Github #2315 - "[Android] Changing from Portrait to Landspace while the calendar is open causes MinimumDate and MaximumDate to be visually ignored" (#4190)
  • Github #2322 - "[MacOS] Image from file not getting searched in the bundle" (#4247)
  • Github #2580 - "Adding accessibility tags to a label seems to cause the renderer to need more space " (#4433)
  • Github #2642 - "ControlTemplate sizing issue in WPF" (#2656)
  • Github #2752 - "[Binding] defaultValueCreator ignored Binding to an unresolved path" (#4541)
  • Github #2831 - "[IOS] label not rendering in BOLD when using a STYLE, Droid however works" (#4111)
  • Github #2881 - "[macOS] ContextActions on ListView not working" (#4243)
  • Github #2951 - "CarouselPage child pages don't fire OnAppearing after update to XF 3.0" (#4475)
  • Github #2952 - "[iOS] WebView not render/update HTML source after second call" (#4468)
  • Github #3208 - "Accessibility Name or HelpText properties added to Switch are visible in Android UI" (#4094)
  • Github #3331 - "[UWP] DatePicker allows a date to be selected which violates the MinimumDate property" (#3683)
  • Github #3385 - "[iOS] Entry's TextChanged event is fired on Unfocus even when no text changed" (#3433)
  • Github #3563 - "[Android] Platform.GetRenderer NullReferenceException" (#4567)
  • Github #3622 - "Android TalkBack reads elements behind modal pages" (#4401) (#4404)
  • Github #3715 - "[Feedback] Xamarin UWP ListView not calling ToString()" (#4016)
  • Github #3795 - "[Android/iOS] MasterDetail back button accessibility" (#3974)
  • Github #3930 - "[iOS] Rapidly clicking span on UI test 3525 throws a null exception on simulators" (#4109)
  • Github #3953 - "Java.Lang.NoSuchMethodError: no method with name='getLabelFor' signature='()I' in class Landroid/widget/TextView;" (#3996)
  • Github #3979 - "UWP: InvalidCastException on a Span with a style set via a dynamic resource" (#4024)
  • Github #3994 - "Binding does not update view when BindingContext is page itself" (#4028)
  • Github #4018 - "[Android] Entry resets FontFamily to default" (#4019)
  • Github #4026 - "Bindable Span height Issue" (#4448)
  • Github #4030 - "[macOS] Unhandled exception when switching pages: System.InvalidOperationException: Stack empty." (#4242)
  • Github #4040 - "Label TextColor is not Change When using FormattedString" (#4043)
  • Github #4053 - "AutomationProperties.Name on Button is visible on Android" (#4094)
  • Github #4093 - "When changing IsPassword property of an entry in runtime into true, the keyboard setting of entry is changed from numeric to default" (#4181)
  • Github #4103 - "TargetNullValue does not work with x:DataType" (#4490)
  • Github #4107 - "[Android] WebView breaks previewer on Android" (#4428)
  • Github #4116 - "[UWP] If a control rendered by ViewToRendererConverter is off the screen it causes UWP to crash" (#4532)
  • Github #4130 - "EventHandler Signature Error in 3.3.0 " (#4134)
  • Github #4194 - "SearchBar changes color if initial state is invisible" (#4229)
  • Github #4253 - "Javascript alert dialogs don't work when using WKWebView" (#4254)
  • Github #4262 - "Label HorizontalTextAlignment="Center" not working in conjunction with LineHeight on iOS " (#4275)
  • Github #4295 - "Label Underline TextDecoration disappears after text change" (#4322)
  • Github #4303 - "[Android] TabbedPage's child is appearing before it should be" (#4309)
  • Github #4319 - "OnPlatform/OnIdiom markup extension not working using NamedSize" (#4500)
  • Github #4351 - "Previewer broken with latest Xamarin.Forms master builds" (#4355)
  • Github #4360 - "UWP: TapGestureRecognizer works on Layout only if BackgroundColor is set" (#4508)
  • Github #4366 - "[CollectionView] Failure to set ItemsSource causes an unhandled exception to occur" (#4536)
  • Github #4381 - "[iOS] crash on reused page with ScrollView" (#4489)
  • Github #4438 - "Compiled Bindings: Compilation Error - Object reference not set to an instance of an object" (#4483)
  • Github #4446 - "Unhandled Exception with boolean binding when ConverterParameter set instead of Converter" (#4453)
  • Github #4458 - "[UWP] Label MaxLines doesn't work" (#4528)
  • Github #4463 - "uwp's width of Control in titleview not auto change" (#4532)
  • Github #4474 - "[iOS] Number of items not updating with Collection View Control Gallery tests" (#4535)
  • Github #4484 - "[Android] ImageButton inside NavigationView.TitleView throw exception during device rotation." (#4507)
  • Github #4516 - "Binding to an empty collection with indexing throws unhandled exception" (#4525)
  • Github #4596 - "[Shell] queryParams in navigation not handled" (#4615)
  • Github #4603 - "[Shell] Shell push/pop Navigation broken" (#4604)

Additional fixes included in this release

  • "[Android] fix tabs from element with a tabstop false" (#4362)
  • "[Core] Fix check for CollectionView flag" (#4471)
  • "[Core] perf fixes on BindingExpression.TryConvert" (#4443)
  • "[GTK] Add support for ClickGestureRecognizer" (#3971)
  • "[GTK] Fix several memory leaks in the GTK backend" (#4112)
  • "[Shell] allow missing trailing slash on uri" (#4595)
  • "[Tizen] Fix PropagateEvent value properly on Cells" (#4191)
  • "[Tizen] Fix ToolbarItem" (#4416)
  • "[Xaml] Add provided value to collection" (#4456)
  • "[XamlC] Explicitly cast values for ldc.i4" (#4301)
  • "[XamlC] Port #1035 to compiled bindings" (#4454)
  • "Fix edge case in unsubscribing weak events" (#4538)
  • "Navigation Page double Popped event Workaround" (#3851)
  • "Set ImageButton property of Android.ImageButtonRenderer public" (#4534)
  • "WPF - Map - Fix initial load of pins" (#4304)

Known Issues

To track known issues as we work through these new features, check GitHub.

Known Issues as of pre3

  • Github #5019 - "[iOS] CollectionView alignment when using Grid"
  • Github #4970 - "[Shell] Route navigation doesn't seem to work"
  • Github #4943 - "Issue4600.cs can't run"
  • Github #4936 - "[CollectionView] The Horizontal Grid test layout looks different on iOS vs Android"
  • Github #4935 - "[CollectionView] setting snap to Mandatory Snap Type only updates grid on Android"
  • Github #4872 - "[Shell] CSS is not working when referencing CSS-file in App.xaml"
  • Github #4856 - "App Crashes on nested Shell section"
  • Github #4845 - "[Shell] Back button behavior failures"
  • Github #4840 - "[Shell] ContentPage with UseSafeArea incorrectly renders"
  • Github #4767 - "[Shell] BackButtonBehavior is used to override the icon"
  • Github #4766 - "[Shell] Cannot set hamburger button asset"
  • Github #4762 - "[Shell] DisplayActionSheet "
  • Github #4755 - "[Shell] Control loses focus after appearing"
  • Github #4741 - "[Previewer] Errors running Previewer with 4.0 features"
  • Github #4684 - "Xamarin 4.0.0.8055-pre1 Shell Crashes when navigating too quickly"
  • Github #4683 - "Xamarin 4.0.0.8055-pre1 Shell doesn't load the Stylesheets on first presenting pages on Android."
  • Github #4663 - "[Shell] Android bottom drawer menu items throw exception on navigation"
  • Github #4658 - "[CollectionView, UWP] Updating items shows white rows"
  • Github #4652 - "[iOS,Android] TapGestureRecognizer doesn't work for first cells of CollectionView"
  • Github #4644 - "[iOS] Additional parameter on ToolbarItemExtensions.ToUIBarButtonItem in XF 4 is a breaking change"
  • Github #4583 - "Visual and FlowDirection don't propagate down into CollectionView Elements"
  • Github #4399 - "[Shell] MenuItems outside of collection render differently"
  • Github #4342 - "[Shell] Page content on iOS is cut off"
  • Github #3875 - "[Shell] Flyout menu items should start below my header, no matter how tall"
  • Github #3864 - "[Shell] Adding ShellContent directly under ShellItem causes XAML editor warning in VS"
  • 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"

Breaking Changes

  • Github #1788 - "[Enhancement] Seal public attributes " (#4559)
  • Github #4629 - "Picker/DatePicker/TimePicker on iOS iPad should NOT have word suggestions" (#4824) (added in 4.0.0.94569-pre3 (4.0.0 Pre Release 3))

API Changes

  • " Implemented colored refresh indicator for ListView pull-to-refresh" (#2961)
  • "[XamlC] Resolve parameters in nested generics" (#4061)
  • "Navigation Page double Popped event Workaround" (#3851)
  • "Remove unnecessary ToArray to reduce number of BindableObject[] allocations" (#4101)
  • Github #1718 - "[Enhancement] Bindable Repeater control" (#4052)
  • Github #1788 - "[Enhancement] Seal public attributes " (#4559)
  • Github #2057 - "[UWP] Enable dynamic overflow on ToolbarItems" (#4022)
  • Github #2691 - "Make XmlnsDefinitionAttribute Public" (#2782)
  • Github #3172 - "Xamarin.Forms.CollectionView Spec" (#4265)
  • Github #3555 - "[Enhancement] Editor: Control over text-prediction " (#4023)
  • Github #3715 - "[Feedback] Xamarin UWP ListView not calling ToString()" (#4016)
  • Github #3843 - "[Enhancement] Hide Scroll Bars on ListView" (#3897)
  • Github #3988 - "[UWP] Expose platform specific to set IsDynamicOverflowEnabled on the CommandBar" (#4022)
  • Github #4027 - "Adding OnColor property for SwitchCell" (#4036)
  • Github #4435 - "Spec: Visual" (#4449) (#4967)
  • Github #4592 - "[Shell] compile the DataTemplateExtension" (#4641) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4625 - "[Shell] statically expose the current shell" (#4626) (added in 4.0.0.62955-pre2 (4.0.0 Pre Release 2))
  • Github #4951 - "[Material] Contained Button Spec" (#4449) (#4967)

Blogs

Blogs

Feedback welcome

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: