Xamarin.Forms 1.2.0 [Un]Released

TheRealJasonSmithTheRealJasonSmith USXamarin Team Xamurai
edited July 2014 in Xamarin.Forms

We have pulled this release, it is no longer listed on nuget.org, there are serious issues that slipped past validation.

Go get em on Nuget.org

Zip file attached here if for some reason nuget lets you down, they are the exact same build however. Sorry for the longer than normal cycle for this release.

Enhancements

  • Page.DisplayAlert() now has an overload to specify a single button.
  • Page.Icon, ToolbarItem.Icon and NavigationPage.TitleIcon are now FileImageSource.
  • MultiPage<T> 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.

Fonts

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

Fixes

  • 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.

Posts

  • JoeBoothJoeBooth USMember ✭✭

    CarouselPage on Android seams to be broken - i get a black screen + soft lock;

    it does not make it as far as SizeChanged

  • DanZhuDanZhu CNMember ✭✭

    NO swipe ?

  • RyanHatfieldOldRyanHatfieldOld USMember, Insider ✭✭✭

    Release on a Friday? Brave sir.

  • DanZhuDanZhu CNMember ✭✭
    edited July 2014

    Oh, Update to 1.2 My app not work.
    Button [] segmengBtns = new Button[]
    {
    new Button() { Text = "Message", CommandParameter = 0,BackgroundColor =Color.FromRgb(0xD3, 0xD3, 0xD3),TextColor =Color.Green,BorderRadius = 0 },
    new Button() { Text = "control", CommandParameter = 1,BackgroundColor =Color.FromRgb(0xD3, 0xD3, 0xD3),TextColor =Color.Black,BorderRadius = 0 },
    new Button() { Text = "more", CommandParameter = 2,BackgroundColor =Color.FromRgb(0xD3, 0xD3, 0xD3),TextColor =Color.Black,BorderRadius = 0 },
    };
    Label[] segmengLabels = new Label[]
    {
    new Label() { BackgroundColor= Color.Green },
    new Label() { BackgroundColor= Color.FromRgb(0xD3, 0xD3, 0xD3) },
    new Label() { BackgroundColor= Color.FromRgb(0xD3, 0xD3, 0xD3) }
    };
    var grid = new Grid
    {
    ColumnSpacing = 0,
    RowSpacing = 0,
    BackgroundColor = Color.FromRgb(0x22, 0x22, 0x22)
    };
    for (int i = 0; i < segmengBtns.Length; i++)
    {
    grid.ColumnDefinitions.Add(new ColumnDefinition() { Width = new GridLength(1, GridUnitType.Star) });
    }
    //=====================================
    grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(38, GridUnitType.Absolute) });
    grid.RowDefinitions.Add(new RowDefinition() { Height = new GridLength(30, GridUnitType.Absolute) });

            for (int i = 0; i < 3; i++)
            {
                if (i < segmengBtns.Length)
                {
                    grid.Children.Add(segmengBtns[i], i, 0);
    
                }
    
                if (i < segmengLabels.Length)
                {
                    grid.Children.Add(segmengLabels[i], i, 1);   **// if add this  the app will die**
                }
            }
    
    
            layout.Children.Add(grid);
    

    //============= =======================

  • DanZhuDanZhu CNMember ✭✭
    edited July 2014

    I changed
    Label[] segmengLabels = new Label[]
    {
    new Label() { BackgroundColor= Color.Green },
    new Label() { BackgroundColor= Color.FromRgb(0xD3, 0xD3, 0xD3) },
    new Label() { BackgroundColor= Color.FromRgb(0xD3, 0xD3, 0xD3) }
    };

    to

    BoxView[] segmengLabels = new BoxView[]
    {
    new BoxView() { Color = Color.Green },
    new BoxView() { Color = Color.FromRgb(0xD3, 0xD3, 0xD3) },
    new BoxView() { Color = Color.FromRgb(0xD3, 0xD3, 0xD3) }
    };

    //========== it works.

    Oh, I know in 1.2 version Label must have text property.
    Label[] segmengLabels = new Label[]
    {
    new Label() {Text = "1", BackgroundColor= Color.Green },
    new Label() {Text = "1", BackgroundColor= Color.FromRgb(0xD3, 0xD3, 0xD3) },
    new Label() { Text = "1",BackgroundColor= Color.FromRgb(0xD3, 0xD3, 0xD3) }
    };
    ** this works**

  • michaelwalmsleymichaelwalmsley USMember ✭✭

    why does the zip file just contain the nupkg file. it should contain the dlls in the appropriate folders. Particularly as you said " if for some reason nuget lets you down".

  • michaelwalmsleymichaelwalmsley USMember ✭✭

    I didn't realise the nupkg file was just a zip file.

  • PhilipParkerPhilipParker USMember

    Did this just break data templates ?

    Before the update, I had a simple (working!) xamarin forms xaml datatemplate.

    Now I get the following on startup:

    System.Diagnostics.Debugger.Mono_UnhandledException (ex={System.InvalidOperationException: Binding instances can not be reused
    at Xamarin.Forms.BindingExpression.Apply (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty)
    at Xamarin.Forms.Binding.Apply (object,Xamarin.Forms.BindableObject,Xamarin.Forms.BindableProperty)
    at Xamarin.Forms.BindableObject.ApplyBindings (object)
    at Xamarin.Forms.BindableObject.BindingContextPropertyBindingPropertyChanged (Xamarin.Forms.BindableObject,object,object)
    at Xamarin.Forms.BindableObject.SetValueActual (Xamarin.Forms.BindableProperty,object,bool,bool,bool)
    at Xamarin.Forms.BindableObject.SetValueCore (Xamarin.Forms.BindableProperty,object,bool,bool,bool)
    at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object,bool)
    at Xamarin.Forms.BindableObject.SetValue (Xamarin.Forms.BindableProperty,object)
    at Xamarin.Forms.BindableObject.set_BindingContext (object)
    at Xamarin.Forms.TemplatedItemsList2<Xamarin.Forms.ItemsView1<Xamarin.Forms.Cell>, Xamarin.Forms.Cell>.CreateContent (int,object,bool) <0x00137>
    at Xamarin.Forms.TemplatedItemsList2<Xamarin.Forms.ItemsView1<Xamarin.Forms.Cell>, Xamarin.Forms.Cell>.GetOrCreateContent (int,object) <0x0009f>
    at Xamarin.Forms.TemplatedItemsList2<Xamarin.Forms.ItemsView1<Xamarin.Forms.Cell>, Xamarin.Forms.Cell>.get_Item (int) <0x0006f>
    at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellsFromPosition (int,int)
    at Xamarin.Forms.Platform.Android.ListViewAdapter.GetCellForPosition (int)
    at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (int,Android.Views.View,Android.Views.ViewGroup)
    at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (intptr,intptr,int,intptr,intptr) [0x0001a] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.12-series/163212a9/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Widget.BaseAdapter.cs:460
    at (wrapper dynamic-method) object.7d6bb2ee-0d73-4078-b07e-53aa5c273e6c (intptr,intptr,int,intptr,intptr)
    }) in

  • JeremyBrooksJeremyBrooks USMember
    edited July 2014

    I have a problem with IValueConverter after this update. In my XAML I have:
    <Label Text="{Binding value, StringFormat='{0}'}"
    WidthRequest="50"
    TextColor="Black"
    BackgroundColor="{Binding Severity, Converter={StaticResource SeverityColorConverter}}"
    XAlign="Center" YAlign="Center">

    which was working pre-1.2.0. Now I get errors:
    SetValue: Can not convert Normal to type 'Xamarin.Forms.Color'
    SetValue: Can not convert Warning to type 'Xamarin.Forms.Color'
    SetValue: Can not convert Critical to type 'Xamarin.Forms.Color'

    SeverityColorConverter is defined:
    <ContentPage.Resources>
    <ResourceDictionary>
    <localShared:SeverityColorConverter x:Key="SeverityColorConverter" />
    </ResourceDictionary>
    </ContentPage.Resources>

    Nothing in the code changed, I just updated and now I get these errors. Also, I set a breakpoint in SeverityColorConverter and it never gets hit.

  • DanZhuDanZhu CNMember ✭✭

    Button‘s Text will jump to left. after click. how to set the text XAlign = Centre

  • MaruMaru DEMember ✭✭

    While reading all of this and on top of this on a friday, I'm really afraid to update because it could wreck my whole project again so I can't work with it anymore like with the last patch...

    Is there a way to revert an update or update to a specific version instead of the newest?

    And are these all the changes? I think I read that for this update it was said to contain changes in Android ListView performance, references from Images keeps in background and Image Aspect ratio not respected?

  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭
    edited July 2014

    @JeremyBrooks‌ : could you share the full xaml file (in a pastebin e.g.) and the code of your converter ? thx.

  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭

    @PhilipParker‌: could you share a short sample triggering the issue ? thx.

  • StephaneDelcroixStephaneDelcroix USInsider, Beta ✭✭✭✭

    @Danzhu could you share a short sample triggering the issue ? thanks

  • DanielLDanielL PLInsider ✭✭✭✭

    $exception {System.NullReferenceException: Object reference not set to an instance of an object at Xamarin.Forms.Platform.Android.FormattedStringExtensions.ToAttributed (Xamarin.Forms.FormattedString,Xamarin.Forms.Font,Xamarin.Forms.Color,Android.Widget.TextView) at Xamarin.Forms.Platform.Android.LabelRenderer.UpdateText () at Xamarin.Forms.Platform.Android.LabelRenderer.OnElementChanged (Xamarin.Forms.Platform.Android.ElementChangedEventArgs1<Xamarin.Forms.Label>) <IL 0x0003e, 0x00187> at Xamarin.Forms.Platform.Android.VisualElementRenderer1<Xamarin.Forms.Label>.SetElement (Xamarin.Forms.Label) <0x004df> at Xamarin.Forms.Platform.Android.VisualElementRenderer1<Xamarin.Forms.Label>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x0012b> at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) <IL 0x00022, 0x0013f> at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement,Xamarin.Forms.Platform.Android.IVisualElementRenderer,Xamarin.Forms.Platform.Android.RendererPool,bool) <IL 0x00011, 0x000ff> at Xamarin.Forms.Platform.Android.VisualElementPackager.SetModel (Xamarin.Forms.VisualElement,Xamarin.Forms.VisualElement) <IL 0x00129, 0x009eb> at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () <IL 0x0000d, 0x0008b> at Xamarin.Forms.Platform.Android.VisualElementRenderer1<Xamarin.Forms.View>.SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager) <0x00083> at Xamarin.Forms.Platform.Android.VisualElementRenderer1<Xamarin.Forms.View>.SetElement (Xamarin.Forms.View) <0x00583> at Xamarin.Forms.Platform.Android.VisualElementRenderer1<Xamarin.Forms.View>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x0012b> at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) at Xamarin.Forms.Platform.Android.VisualElementPackager.AddChild (Xamarin.Forms.VisualElement,Xamarin.Forms.Platform.Android.IVisualElementRenderer,Xamarin.Forms.Platform.Android.RendererPool,bool) at Xamarin.Forms.Platform.Android.VisualElementPackager.SetModel (Xamarin.Forms.VisualElement,Xamarin.Forms.VisualElement) at Xamarin.Forms.Platform.Android.VisualElementPackager.Load () at Xamarin.Forms.Platform.Android.VisualElementRenderer1<Xamarin.Forms.View>.SetPackager (Xamarin.Forms.Platform.Android.VisualElementPackager) <0x00083> at Xamarin.Forms.Platform.Android.VisualElementRenderer1<Xamarin.Forms.View>.SetElement (Xamarin.Forms.View) <0x00583> at Xamarin.Forms.Platform.Android.VisualElementRenderer`1<Xamarin.Forms.View>.Xamarin.Forms.Platform.Android.IVisualElementRenderer.SetElement (Xamarin.Forms.VisualElement) <0x0012b> at Xamarin.Forms.Platform.Android.RendererFactory.GetRenderer (Xamarin.Forms.VisualElement) at Xamarin.Forms.Platform.Android.ViewCellRenderer.GetCellCore (Xamarin.Forms.Cell,Android.Views.View,Android.Views.ViewGroup,Android.Content.Context) at Xamarin.Forms.Platform.Android.CellRenderer.GetCell (Xamarin.Forms.Cell,Android.Views.View,Android.Views.ViewGroup,Android.Content.Context) at Xamarin.Forms.Platform.Android.CellFactory.GetCell (Xamarin.Forms.Cell,Android.Views.View,Android.Views.ViewGroup,Android.Content.Context,Xamarin.Forms.View) at Xamarin.Forms.Platform.Android.ListViewAdapter.GetView (int,Android.Views.View,Android.Views.ViewGroup) at Android.Widget.BaseAdapter.n_GetView_ILandroid_view_View_Landroid_view_ViewGroup_ (intptr,intptr,int,intptr,intptr) [0x0001a] in /Users/builder/data/lanes/monodroid-mlion-monodroid-4.14-series/528056fd/source/monodroid/src/Mono.Android/platforms/android-19/src/generated/Android.Widget.BaseAdapter.cs:460 at (wrapper dynamic-method) object.469af010-d0af-4f4c-913e-6650727774e0 (intptr,intptr,int,intptr,intptr) } System.NullReferenceException

  • ScottBradleyScottBradley AUMember ✭✭

    For @Maru‌ and anyone else who wants to revert to the previous version on Xamarin Studio.

    This worked for me.

  • I have the same issues with android, listviews and observable collections as @DanielL‌. This I holding back our release.

  • GautamJainGautamJain INMember ✭✭✭
    edited July 2014

    +1 to issues faced by @klofberg & @DanielL‌ . I am waiting for fixes.

  • sbrsbr CAMember ✭✭

    I am also having the issue with ListViews showing items randomly during scrolling...in fact I wasted a lot of time under the impression that it was my own bug. How has this gone unfixed for so long?

  • DerekPapworth.4183DerekPapworth.4183 GBMember ✭✭

    I have to say really disappointed as excited to see 1.2.0 release but then discover nothing fixed in terms of ToolbarItems which has a number of issues reported both in general and in this thread from myself :

    https://forums.xamarin.com/discussion/comment/61574#Comment_61574

    and also nothing on turning off animation when push/pop pages as in :

    https://forums.xamarin.com/discussion/comment/61123#Comment_61123

    It feels like a lot of our comments/bugs reported are just being ignored which having reengineered our apps to use .Forms it's putting us in backwards situation as I for one am having to start revert to not using .Forms just to get back to functionality that I used to have but isn't working in .Forms.

    Sorry to be negative but it's such a potentially good product but it just isn't getting fixed to be usable as yet .. and for me the ToolbarItems issues is fundamental as it's the major navigation method in basic .Forms itself.

  • sbrsbr CAMember ✭✭

    I'm finding that I'm basically just using Xamarin.Forms as an abstraction layer and writing platform-specific controls where I can...now I'm going to see if I can make my own ListView (inheriting from View) that just does enough stuff for what I need and is implemented completely at the platform level, rather than dealing with Cells and whatever weird caching behaviour is happening on Android. I just hope the renderer API is flexible enough to accomodate.

  • JeremyBrooksJeremyBrooks USMember

    I made a simple project to try to reproduce my IValueConverter issue, but it works correctly there -_-.

  • DanielLDanielL PLInsider ✭✭✭✭
    edited July 2014

    If you're having problem with random NullReference exceptions, i got it resolved by using custom converter for labels. It looks like Label.Text cannot be null with X.F 1.2.0.

        public class StringConverter : IValueConverter
        {
            #region IValueConverter implementation
    
            public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
            {
                return value == null ? string.Empty : (string)value;
            }
    
            public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
            {
                throw new NotImplementedException();
            }
    
            #endregion
        }
    

    Another Android minor bug:
    If you disable Button, it's text label layout changes from "center" to "start". After reenabling it it stays like that.

  • ChWoChWo DEMember
    edited July 2014

    This version seems to be completely failing.
    How can I go back to an older version (using VS2013)?

    EDIT: Did it the hard way.
    - Changed Xamarin.Forms' version number in packages.config to 1.1.1.6206
    - Changed version numbers in .csproj-files to 1.1.1.6206
    - Deleted all files matching xamarin.forms in my solution folder
    - Restored all packages via NuGet

    @Xamarin: I spent two hours to install, test, repair and uninstall this version. It's unusable. Please mark future realeases as beta version.

  • ChaseFlorellChaseFlorell CAInsider, University mod

    Glad I released before trying to update! Looks like I missed out on all the "fun" though.

Sign In or Register to comment.