Forum Xamarin.Forms

Xamarin.Forms 1.2.1 Released



  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭

    @ChaseFlorell‌ not deleted:

    - Page.DisplayAlert() now has an overload to specify a single button.
    - Page.Icon, ToolbarItem.Icon and NavigationPage.TitleIcon are now FileImageSource.
    - MultiPage now has a CurrentPageChanged event.
    - Editor now has a Completed event.
    - Button.BorderWidth is now a double.
    - NavigationPage now has BarTextColor and BarBackgroundColor which replaces Tint.
    - VisualElement now provides TranslationX and TranslationY.
    - [XAML] OnPlatform can now be used with Image.Source without having to specify FileImageSource.
    - [XAML] {Binding} can now be used to create the binding for ListView.GroupDisplayBinding (rather than applying a binding to the GroupDisplayBinding property.)
    - [Binding] Bindings now will automatically convert types where possible.
    - VisualElement now supports TranslateX and TranslateY. These properties allow you to translate a view post layout, enabling easy creation of slide-in/slide-out style effects for views without having to write a custom layout.

    - Font properties are now exposed.
    - FontAttributes has been introduced starting with Bold and Italic.
    - BoldSystemFontOfSize is now deprecated in favour of SystemFontOfSize which uses FontAttributes.

    - CancelAnimations should now properly cancel LayoutTo, TranslateTo, RotateYTo and RotateXTo.
    - [Binding] Bindings now respect a null or String.Empty property name from INotifyPropertyChanged as an update to all properties.
    - [XAML] x:Reference and x:StaticResource may now be used before the referenced item is declared.
    - [XAML] Single Grid column/row definitions in XAML are now properly respected.
    - [XAML] Literals are now parsed with InvariantCulture.
    - [XAML] A code-behind field will no longer be generated for ToolbarItem.Name.
    - [Android] PushModal and PopModal now animate.
    - [Android] Context is valid after Init() has been called.
    - [Android] Button.BackgroundColor no longer leaks memory.
    - [Android] Bindings before SetPage() is called should no longer throw NullReferenceException.
    - [iOS] ListView will no longer scroll to the top of the page when the SelectedItem is cleared.
    - [iOS] Label will now revert to the default font if the given one could not be found, instead of crashing.
    - [iOS] ListView.HasUnevenRows now properly respected.
    - [WP] EntryCell now properly respects Disabled.
    - [WP] ScrollView horizontal scrolling now works properly.

  • MihaMarkicMihaMarkic SI ✭✭✭✭

    Not sure whether this belongs here: Blank App (Forms) template (VS2013) is broken somehow for Android. Activity attribute is declared as this:

    [Activity (Label = "App13", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation))]

    There is one too much closing parentheses, it should be:

    [Activity (Label = "App13", MainLauncher = true, ConfigurationChanges = ConfigChanges.ScreenSize | ConfigChanges.Orientation)]

    Furthemore ConfigChanges is missing namespace, should be added:

    using Android.Content.PM;

    Anybody else seeing this problem when creating a new project in VS2013U2?

  • ChaseFlorellChaseFlorell CAInsider, University mod

    Thank you @StephaneDelcroix‌, I guess it just wasn't pinned any longer. That's going to be a helpful bit when people ask questions like this one

  • CraigDunnCraigDunn USXamarin Team Xamurai

    @MihaMarkic‌ yep, we've got that bug recorded. The templates ship with Xamarin Studio and Visual Studio plug-in updates (not with Xamarin.Forms releases in NuGet) so those fixes will come with a future update on the regular Xamarin alpha/beta/stable channels.

  • Sten.PetrovSten.Petrov USMember

    Latest release broke my build, it complained on all BindableObject.CreateAttached that it can't convert the second type parameter to TPropertyType.

    Manually reverted to previous version to fix the issue

  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭

    @Sten.Petrov‌ could you share more information ? the code on which it fails, the stacktrace... Thanks.

  • Sten.PetrovSten.Petrov USMember

    I had two projects - one with updated Xamarin.Forms ( and one with the previous version ( The newer version project didn't compile, the older one - compiled and worked fine, both sharing the same code. After manually reverting to both projects compile

    /Users/Sten/Projects/CMPNVOC/CMPNVOC/Xaml/ListBehaviors.cs(26,26): Error CS0029: Cannot implicitly convert type bool' toTPropertyType' (CS0029) (CMPNVOC.Forms)

    /Users/Sten/Projects/CMPNVOC/CMPNVOC/Xaml/ListBehaviors.cs(26,26): Error CS1662: Cannot convert lambda expression' to delegate typeSystem.Func<Xamarin.Forms.BindableObject,TPropertyType>' because some of the return types in the block are not implicitly convertible to the delegate return type (CS1662) (CMPNVOC.Forms)

    /Users/Sten/Projects/CMPNVOC/CMPNVOC/Xaml/ListBehaviors.cs(30,30): Error CS1502: The best overloaded method match for `Xamarin.Forms.BindableProperty.Created<TDeclarer,TPropertyType>(System.Linq.Expressions.Expression<System.Func<Xamarin.Forms.BindableObject,TPropertyType>>, TPropertyType, Xamarin.Forms.BindingMode, Xamarin.Forms.BindableProperty.ValidateValueDelegate, Xamarin.Forms.BindableProperty.BindingPropertyChangedDelegate, Xamarin.Forms.BindableProperty.BindingPropertyChangingDelegate, Xamarin.Forms.BindableProperty.CoerceValueDelegate)' has some invalid arguments (CS1502) (CMPNVOC.Forms)

    line 26 from ListBehaviors:

     public static readonly BindableProperty RefreshOnItemUpdateProperty = 
                BindableProperty.CreateAttached<ListView, bool> (
                    (bob) => GetRefreshOnItemUpdate (bob)
                    , false
                    , BindingMode.OneWay
                    , bindingPropertyChanged: (bindable, oldvalue, newvalue) => {
                    if (bindable != null && bindable is ListView) {
                        ListView listView = (ListView)bindable;
                        INotifyCollectionChanged items = listView.ItemsSource as INotifyCollectionChanged; 
                        NotifyCollectionChangedEventHandler collectionChangedHandler = (s, e) => {
                            listView.Refresh (); // this is an extension method
                        if (items != null) {
                            items.CollectionChanged += collectionChangedHandler;
                        } else {
                            PropertyChangedEventHandler evh = null;
                            evh = (s, e) => {
                                items = listView.ItemsSource as INotifyCollectionChanged; 
                                if (e.PropertyName == "ItemsSource" && items != null) { 
                                    listView.PropertyChanged -= evh;
                                    items.CollectionChanged += collectionChangedHandler;
                            listView.PropertyChanged += evh;
            public static bool GetRefreshOnItemUpdate (BindableObject listView)
                return (bool)listView.GetValue (RefreshOnItemUpdateProperty);
            public static void SetRefreshOnItemUpdate (ListView listView, bool value)
                listView.SetValue (RefreshOnItemUpdateProperty, value);
  • EricGroverEricGrover USMember ✭✭

    I have experienced significant trouble with the Grid, StackLayout, and ScrollView controls in the new release. I have submitted bug report e-mails for them. These are show stopping issues that need to be addressed. Has anyone else experienced these issues?

  • PhilipParkerPhilipParker USMember

    From what I've seen StackLayout is badly broken when dealing with other controls being dynamically added to the same page.

    I previously thought this was limited to it being used in combination with ScrollView. But after further tests it looks like its not even limited to that. If you have two StackLayout's on the same page, and you add controls (views) dynamically to one stacklayout in response to button clicks on buttons in the other StackLayout it screws up the buttons alignment.

    It also looks like it may do the same thing with the combination of StackLayout's and ListView's and dynamically adding content to the listview (by adding data to a databound observablecollection). This though would take more testing to confirm for definite.

    However, these bugs are not new to the latest release.

    Looks to me like I have to at minimum completely avoid StackLayout's if I'm to use Xamarin.Forms.

  • AlanTonissonAlanTonisson AUMember ✭✭
    edited July 2014

    Watch out for the change to Font.SystemFontOfSize in

    var copyright = new Label();
    copyright.Text = "Copyright Rune Research Pty Ltd";
    copyright.VerticalOptions = LayoutOptions.Center;
    copyright.Font = Font.SystemFontOfSize(16);

    This used to work fine, but now it throws a System.TypeLoadException on the last line.

    The argument type has changed and is now an enum.

  • AlanTonissonAlanTonisson AUMember ✭✭

    Tip for young players: don't forget to update each instance of the Xamarin.Forms package when you update one of them.

  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭

    @Sten.Petrov: oh, the parameter name has been changed. it's propertyChanged instead of bindingPropertyChanged. mono compiler doesn't generate a good error message for this, but I suspect this is it.

  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭

    @AlanTonisson‌ : always update packages at the solution level

  • LauraGrossoLauraGrosso ITMember, University
    edited July 2014


    I don't know if I'm doing something wrong, but the Blank application does not run for me if I upgrade the packages to

    My environment:

    • Windows 8
    • Xamarin Studio 5.1.4 (build 0)

    I do this:

    • create new Blank (Portable) application
    • update PCL project's Xamarin.Forms package to 1.2.1
    • update android project's Xamarin.Forms package to 1.2.1
    • update Xamarin.Android.Support v4 to 20.0
    • set android project as startup project
    • run the app, which printed correctly "hello world" with the previous package

    I get the error

    System.Diagnostics.Debugger.Mono_UnhandledException (ex={System.NullReferenceException: Object reference not set to an instance of an object
    at Xamarin.Forms.Platform.Android.Platform.SetActionBarTextColor ()
    at Xamarin.Forms.Platform.Android.Platform.UpdateActionBarTextColor ()
    at Xamarin.Forms.Platform.Android.Platform.OnLayout (bool,int,int,int,int)
    at Xamarin.Forms.Platform.Android.PlatformRenderer.OnLayout (bool,int,int,int,int)
    at Android.Views.ViewGroup.n_OnLayout_ZIIII (intptr,intptr,bool,int,int,int,int) [0x00009] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/163212a9/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Views.ViewGroup.cs:3274
    at (wrapper dynamic-method) object.7596ba2f-77e2-4f5f-88c2-a07bb2b34a08 (intptr,intptr,bool,int,int,int,int)
    }) in

    This happens both in Genymotion and in any emulator, whatever the API version.

    The Blank application does this:

    using System;
    using Xamarin.Forms;
    namespace thiShared
        public class App
            public static Page GetMainPage ()
                return new ContentPage { 
                    Content = new Label {
                        Text = "Hello, Forms!",
                        VerticalOptions = LayoutOptions.CenterAndExpand,
                        HorizontalOptions = LayoutOptions.CenterAndExpand,
  • MihaMarkicMihaMarkic SI ✭✭✭✭

    @LauraGrosso‌ Either wrap everything into NavigationPage or downgrade Forms (for both see this thread). Of course, both are temporary workarounds.

  • LauraGrossoLauraGrosso ITMember, University

    Thanks Miha!

  • Namely, the boilerplate app should be changed from:
    return new ContentPage {


                return new NavigationPage (new ContentPage { 
  • ChaseFlorellChaseFlorell CAInsider, University mod

    @RiccardoMoschettiItaly‌ Changing the app would only serve to work around the problem. The Xamarin team is fixing the bug, and therefore the work-around would become moot. The only real reason to use a NavigationPage is for navigation purposes... a single page app for example doesn't need it other than to work around the above mentioned bug.

  • @ChaseFlorell‌ you are totally right. The workaround will become superfluous when the fix comes.

    My indication was intended for the people above who couldn't start the blank app and might have wanted to do so, for demo purposes. Of course the "official" template will not need the change when the fix comes.

Sign In or Register to comment.