Xamarin.Forms 1.3.0 Technology Preview

TheRealJasonSmithTheRealJasonSmith Jason SmithUSXamarin Team Xamurai

Hey Guys!

We are pleased to announce a technical preview of the 1.3.0 release with new features. Please note that this is almost all the features going into 1.3.0 and we will after this release be continuing to focus on bug and performance work. We are putting out the technology preview so we can get your feedback on how the new features work with your app and if there are any changes or improvements that need to be made.

This release is NOT in nuget.org and will be in the forums only until the -pre1 release which will contain a more respectable number of bug fixes as well.

Features

  • Add DefaultValueCreator to BindableProperties to allow dynamic allocation of default values in bindable properties (prevents BP's from having to share the same object instance for default values)
  • Behaviors
  • Triggers
  • Implement Binding.Source
  • Added ListView.ScrollTo

Xamarin.Forms.Application

  • Supports easy changing of root page
  • Persistent data store via Properties dictionary
  • Sleep/Resume/Start events
  • Application level resource dictionary

Dynamic Resources

  • Supported in XAML via {DynamicResource key}
  • Supported in code via SetDynamicResource (BindableProperty property, string key);

Styles

  • Support styles in XAML and in code
  • Allow styles to be based on DynamicResources via Style.BaseResourceKey
  • Add platform specific styles via Device.Styles (supports iOS dynamic type)

Font Changes

  • Obsolete Font struct (still works for forseeable future, except with styles)
  • Add Label.FontFamily, Label.FontSize, Label.FontAttributes
  • Add Button.FontFamily, Button.FontSize, Button.FontAttributes

Improvements

  • Reduce memory footprint of BindableObject
  • Several small performance improvements to BindableObject
  • WebView now supports GoBack/Forward + Navigation events

Bug Fixes

  • [iOS] Fix UIAppearance and NavigationPage integration (NavigationPage no longer overrides UIAppearance settings
  • [Android] ViewCell will now size down to small sizes when requested
  • [Android] Click through settings now mostly match other platforms (Layouts on top of other elements no longer allow clickthrough unless explicitly requested)
  • [Android] Images in ViewCells using UriImageSource's will no longer occasionally get the wrong image at startup
  • [Android] Header cells no longer amazingly small in TableView
  • [XAML] ConstraintExpression can now be used inside of a DataTemplate
  • [XAML] Unfound StaticResources no longer throw an exception
  • [XAML] Improved XAML parsing engine to improve perf and reduce namescoping errors
«1345

Posts

  • ChrisMenningaChrisMenninga Chris Menninga USMember

    An advice on how to install this on XS for Mac? Not too familiar w/ Nuget (aside from very basic consumption of it), and couldn't figure out the command or process to use to install.

  • MihaMarkicMihaMarkic Miha Markic SI ✭✭✭✭

    Unpack it in a folder, add that folder as a nuget source (top left drop down of Add Packages window, pick Configure Sources..)

  • AlexandreReyesMartinsAlexandreReyesMartins Alexandre Reyes Martins BRMember ✭✭

    Great job! How long for the release? A month? two? lol

  • PeterMoorePeterMoore Peter Moore USMember

    Sounds very cool, especially styles and triggers. Any plans to support full-blown templated controls in the near future?

  • Nick60Nick60 Nicolò Carandini ITMember, Insider

    Any chance to have Margin property implemented?
    It will help porting Microsoft XAML pages, because changing from Margin to Padding is about moving the property from content to container, not always feasible without side effects.

    If you ever will do it, please add the Margin property into View base class, so we can use it inside every descendant, while actually Padding is present only on Layout and Page descendants.

  • ddotmunchddotmunch Daniel Münch DEMember ✭✭

    Good news! Any details on how the Behaviors are working?

  • chris_riesgochris_riesgo Chris Riesgo USUniversity ✭✭✭

    Great work, guys!

  • nicholasaltnicholasalt nicholas alt USMember

    @JasonASmith‌

    Will 1.3 include support for more gestures or an extensible gesture recognizer class?

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @nicholasalt‌ More gestures are planned yes. I can't say when because I am not sure if I can hit 1.3.

    @Nick60 the plan is to add Margin to the View class yes. Its not trivial to implement since each of the Layouts needs to be updated to support it in some fashion. It also complicates layout logic further which is why we are waiting to do the iOS ListView perf improvements before we add it. Otherwise we will hurt that perf further.

  • DH_HA1DH_HA1 Darren Haligas USMember ✭✭✭

    @JasonASmith‌ are iOS ListView perf improvements slated for 1.3?

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @DH_HA no promises but hopefully yes for the 1.3 final release.

  • DH_HA1DH_HA1 Darren Haligas USMember ✭✭✭
    edited October 2014

    @JasonASmith‌ in 1.3 TP PopToRootAsync fails in this scenario:

    • Dashboard screen - tap to
    • List Screen with ViewCells - select item to
    • Details Screen
      - Button that calls PopToRootAsync

    It only fails when a child page contains a ListView with ViewCells. child pages with TextCells don't cause the exception.

    System.ArgumentNullException: Argument cannot be null.
    Parameter name: first
      at System.Linq.Check.FirstAndSecond (System.Object first, System.Object second) [0x00006] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.2.0.193/src/mono/mcs/class/System.Core/System.Linq/Check.cs:87
      at System.Linq.Enumerable.Except[KeyValuePair`2] (IEnumerable`1 first, IEnumerable`1 second, IEqualityComparer`1 comparer) [0x00000] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.2.0.193/src/mono/mcs/class/System.Core/System.Linq/Enumerable.cs:800
      at Xamarin.Forms.MergedResourceDictionary.OnParentResourcesChanged (IEnumerable`1 values) [0x00000] in <filename unknown>:0
      at Xamarin.Forms.MergedResourceDictionary.set_ParentResourceDictionary (IResourceDictionary value) [0x00000] in <filename unknown>:0
      at Xamarin.Forms.Element.set_Parent (Xamarin.Forms.Element value) [0x00000] in <filename unknown>:0
      at Xamarin.Forms.Element.OnChildRemoved (Xamarin.Forms.Element child) [0x00000] in <filename unknown>:0
      at Xamarin.Forms.Page.OnInternalRemoved (Xamarin.Forms.VisualElement view) [0x00000] in <filename unknown>:0
      at Xamarin.Forms.Page.InternalChildrenOnCollectionChanged (System.Object sender, System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00000] in <filename unknown>:0
      at System.Collections.ObjectModel.ObservableCollection`1[Xamarin.Forms.Element].OnCollectionChanged (System.Collections.Specialized.NotifyCollectionChangedEventArgs e) [0x00014] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.2.0.193/src/mono/mcs/class/System/System.Collections.ObjectModel/ObservableCollection.cs:161
      at System.Collections.ObjectModel.ObservableCollection`1[Xamarin.Forms.Element].RemoveItem (Int32 index) [0x0001a] in ///Library/Frameworks/Xamarin.iOS.framework/Versions/8.2.0.193/src/mono/mcs/class/System/System.Collections.ObjectModel/ObservableCollection.cs:182
      at System.Collections.ObjectModel.Collection`1[Xamarin.Forms.Element].Remove (Xamarin.Forms.Element item) [0x00011] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Collections.ObjectModel/Collection.cs:134
      at Xamarin.Forms.NavigationPage.<PopToRootAsync>b__19 (Xamarin.Forms.Element c) [0x00000] in <filename unknown>:0
      at Xamarin.Forms.EnumerableExtensions.ForEach[Element] (IEnumerable`1 enumeration, System.Action`1 action) [0x00000] in <filename unknown>:0
      at Xamarin.Forms.NavigationPage+<PopToRootAsync>d__1c.MoveNext () [0x00000] in <filename unknown>:0
      at --- End of stack trace from previous location where exception was thrown ---
      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw () [0x0000b] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.ExceptionServices/ExceptionDispatchInfo.cs:62
      at System.Runtime.CompilerServices.TaskAwaiter.GetResult () [0x00034] in /Developer/MonoTouch/Source/mono/mcs/class/corlib/System.Runtime.CompilerServices/TaskAwaiter.cs:60
    
  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @DH_HA‌ doh, thank you. This is why we do these previews. The merged dictionary clearly has a bug somewhere.

  • DH_HA1DH_HA1 Darren Haligas USMember ✭✭✭

    @JasonASmith‌ np. Good work by the way. Very excited about this product. Moving all our apps over it.

    Our biggest hope is same performance to Xamarin.iOS and Xamarin.Android and flexibility to get extend more like the ListView on Android

  • nicholasaltnicholasalt nicholas alt USMember
    edited October 2014

    @JasonASmith‌
    If tap swipe and long tap gestures do not make the 1.3.0 release can we expect them within a 1.3.X release? My company is approaching a critical point deciding if we will stay with Forms or not and gestures are a huge concern.

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @nicholasalt‌ there already are tap gestures?

  • nicholasaltnicholasalt nicholas alt USMember

    @JasonASmith‌

    My mistake in wording, trying to make post between meetings :).

    If swipe and long tap gestures do not make the 1.3.0 release can we expect them within a 1.3.X release?

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @nicholasalt‌ can you explain why you want them by chance? I am curious because the gestures you want make me think you want to implement menus in ListViews, if so we have a better answer :)

    As for those particular gestures, I will be looking into both of them.

  • nicholasaltnicholasalt nicholas alt USMember

    @JasonASmith‌ for expanded options on list items where tap gesture is already used, such as swipe to display edit/delete button, swipe to add to favorites, etc.

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai
    edited October 2014

    @nicholasalt‌ ListView ContextActions are coming, which will use the native gestures and use the native menu to present context actions in lists. Swipe on iOS, LongPress on WinPhone/Android. Supports delete events, the More button on iOS, etc. That will make 1.3

  • PeterMoorePeterMoore Peter Moore USMember

    Any plans to support full-blown templated controls in the near future?

  • MitchMilamMitchMilam Mitch Milam USMember ✭✭✭

    @JasonASmith‌ any docu at all on the new stuff?

  • AlexeiVinidiktovAlexeiVinidiktov Alexei Vinidiktov RU ✭✭

    @JasonASmith‌

    ListView ContextActions are coming

    This is great!!!

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @MitchMilam‌ you know it occurred to me you guys would need docs like 3 hours ago. We haven't had time to write them out in full yet, but here is the gist of it:

    Xamarin.Forms.Application

    The basic gist is you use the FormsApplication[Delegate/Activity/Page] instead of what your templates currently use. New up your custom Application subclass, and call LoadApplication. You still must Forms.Init as you do now.

    Styles

    Go read XAML style documentation and assume a slightly less powerful version. You can find some device specific pre-build styles in Device.Styles

    Implicit styles can be defined as you might expect coming from WPF or Silverlight

    DynamicResources

    If you have used XAML you know what dynamic resources are and should be able to use these just fine.

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @PeterMoore‌ no, there are no plans for this at this time. @ermau‌ will probably stop by later and give a more detailed explanation, however the short version is that Xamarin.Forms isn't a lookless toolkit so it wont make that much sense.

  • MihaMarkicMihaMarkic Miha Markic SI ✭✭✭✭

    @JasonASmith‌ It might make sense in certain scenarios though. Imagine I have a basic page like Header above and few buttons in the footer and the content in between. I'd create a template for the page in this case.

  • MihaMarkicMihaMarkic Miha Markic SI ✭✭✭✭

    I am bit disappointed that modifying/fixing Navigation isn't on the radar at all. Besides history recreation problem there is a bigger flaw: persisting page instances on stack. Here, click button a few times.

    public static Page GetMainPage()
            {
                StackLayout stack = new StackLayout();
    
                Button button = new Button
                {
                    Text = "Click"
                };
                button.Clicked += button_Clicked;
                Image image = new Image
                {
                    Source = "http://blog.rthand.com/images/2014/06/profiler_thumb.png",
                    WidthRequest = 800,
                    HeightRequest = 400
                };
                stack.Children.Add(image);
                stack.Children.Add(button);
                return new NavigationPage(new ContentPage {  Content = stack});
            }
    
            static void button_Clicked(object sender, EventArgs e)
            {
            GC.Collect ();
                Button button = (Button)sender;
                button.Navigation.PushAsync(GetMainPage());
            }
    
  • kenenthbkenenthb Kenneth Brodersen USMember

    This is great news! Keep up the good work :)

  • DirkWeltzDirkWeltz Dirk Weltz DEMember ✭✭✭

    What about animation of pages. Are there any news about this?

  • MitchMilamMitchMilam Mitch Milam USMember ✭✭✭
    edited October 2014

    [removed]

  • StephaneDelcroixStephaneDelcroix Stephane Delcroix USInsider, Beta ✭✭✭✭
    edited October 2014

    @MitchMilam‌ inherits your AppDelegate from FormsApplicationDelegate, that's where you'll find LoadApplication ():

    [Register ("AppDelegate")]
    public partial class AppDelegate : FormsApplicationDelegate
    {
        public override bool FinishedLaunching (UIApplication uiApplication, NSDictionary launchOptions)
        {
            Forms.Init ();
            //FormsMaps.Init ();
    
            LoadApplication (new App ());
            return base.FinishedLaunching (uiApplication, launchOptions);
        }
    }
    
  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @MihaMarkic modifiable back navigation stack is already slated for 1.3.0 as well, and has been planned for this release for months now. It just didn't get implemented in time for this technology preview release. We think you will be satisfied with the upcoming API for that.

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @Charlenni while we have had some small discussions about a page transition API, we have not yet decided on what to do. So unfortunately I cannot speak to a timeframe or even give an absolute affirmative on that yet. Again this is purely due to not having fully flushed through all the ideas and vetted feasibility on all current and future platforms.

  • MitchMilamMitchMilam Mitch Milam USMember ✭✭✭

    @StephaneDelcroix Ha! I just figured that out.

  • MihaMarkicMihaMarkic Miha Markic SI ✭✭✭✭

    @JasonASmith‌ Excellent!

  • DirkWeltzDirkWeltz Dirk Weltz DEMember ✭✭✭

    @JasonASmith: Sorry about this. Especially you could find the most to disable animations in Xamarin.Forms already. If you create your own renderer and set animation to false, the most works. Only animations of pages, that are vanish is not possible.

    So perhaps it is possible to make this flag, in a first step, public, that we could disable animation. Than there is time to make the great step.

  • TheRealJasonSmithTheRealJasonSmith Jason Smith USXamarin Team Xamurai

    @Charlenni part of the modifiable back stack work is including options to navigate without animations

  • DirkWeltzDirkWeltz Dirk Weltz DEMember ✭✭✭

    @JasonASmith: That sounds good.

    So now, my best wishes for your presentation. I would like to join you, but the live stream is limited to one room :(

  • QwinQwin Robert Al Malak USUniversity ✭✭
    edited October 2014

    Couple of things that I would have expected :

    1. GridView ? (again xamarin labs have had it by now implemented if its wasnt for the bugs that are encountered. For iOS we are facing the known issue of no event is getting fired when tapping a collection item. And on Android we are facing that the RendererFactory only gets the first View to native but not the subclasses (well when debugging it seems everything is alright but somehow the children aren't showing only the parent view).

    2. I would love to see a PopModelAsync(int numberOfPagesToPop) and PopAsync(int numberOfPagesToPop).
      I did see this change - Supports easy changing of root page <--- can you explain what that easy changing is ?

    3. ListView and TableView ... Please give us an event for both to Force Refresh if need to be. There are many occasions where it doesn't do it automatically. And even better would be to merge these 2 together already and have a way to have full control over them.

    Specific platform properties call e.g. pseudo :

    
    var viewCell = new ViewCell();
    
    viewCell.iOS.Disclosure = true;
    viewCell.Android.SomeSpecificProperty  = foo;
    
    viewCell.BackgroundColor = Color.Green; //for all platforms
    

    What we noticed is that we want power over all platforms within Xamarin.Forms I am not expecting this options in 1.3. We are now writing renderers for the most simple things on specific platforms. Just thought I mention it.

«1345
Sign In or Register to comment.