Xamarin.Forms 1.3.0

Important notes:

  • Generators for XAML pages should to be updated to use the new tool MSBuild:UpdateDesignTimeXaml instead of MSBuild:Compile
  • Grid default is now *

New API and Enhancements

  • Add MasterDetailPage.ShouldShowToolbarButton method to enable control over the appearance of the toolbar button.
  • Device.GetNamedSize (NamedSize size, Type targetType); Same as Device.GetnamedSize (NamedSize size, Element element) but doesn't require an instance.
  • MasterDetailPage.MasterBehavior : Used to control how the MasterDetailPage renderers the split view between the Master and Detail. Allowed values are:
public enum MasterBehavior
{
    Default,
    SplitOnLandscape,
    Split,
    Popover,
    SplitOnPortrait
}
  • VisualElement.Navigation now contains overloads for all Pushing and Popping methods that accept a boolean parameter to enable/disable animations.
  • INavigation contains methods needed for more complex navigation scenarios:
public interface INavigation
{
    IReadOnlyList<Page> NavigationStack { get; }
    IReadOnlyList<Page> ModalStack { get; }

    void RemovePage (Page page);
    void InsertPageBefore (Page page, Page before);

    Task PushAsync (Page page);
    Task<Page> PopAsync ();
    Task PopToRootAsync ();
    Task PushModalAsync (Page page);
    Task<Page> PopModalAsync ();

    Task PushAsync (Page page, bool animated);
    Task<Page> PopAsync (bool animated);
    Task PopToRootAsync (bool animated);
    Task PushModalAsync (Page page, bool animated);
    Task<Page> PopModalAsync (bool animated);
}
  • New Application class to replace previous methods of turning a Page into a platform specific object.
  • New member on Page: protected virtual bool OnBackButtonPressed (): Override in order to handle physical back button press events. Events bubble down from root page and back up. Unhandled back button events will cause the app to exit. NavigationPage and the Platform still handle the back button as expected, however it is now possible to intercept and modify these behaviors. Not overriding this method retains the existing back button behavior.
  • DependencyService now has Register methods for users needing more advanced ways to register dependencies.
  • WidthRequest, HeightRequest, MinimumWidthRequest, and MinimumHeightRequest are now BindableProperties
  • IViewController, IVisualElementController, and IElementController now available and explicitly implemented on VisualElement. These interfaces will eventually replace all internal API's currently used to communicate between platform renderers and the frontend API.
  • IElementController.SetValueFromRenderer allows for updating of BindableProperties from renderers without accidentally clearing bindings.
  • XAML now supports text as the content node in Label: <Label>Hello World</Label>
  • Pin now has a Clicked property for detecting when the user taps or clicks on a Map pin after the information window is visible.
  • Layout constructor is now marked protected and not internal
  • Styles support Behaviors and Triggers
  • DataTrigger and MultiTrigger added
  • VisualElement.IsFocused is now a BindableProperty
  • Use * as default grid size
  • StaticResource searches in Application.Current.Resources too
  • Add NavigationPage.HasBackButton
  • Fix Fuchsia spelling, Obsolete the old spelling
  • TypeConverter on FontSize
  • SearchBar.CancelButtonColor (currently only supported on iOS)
  • ListView context actions

Bug Fixes

Core

  • Bindings are culture unaware
  • SetValue now properly overrides settings from a Style when the Style is applied later.
  • Grid now has more nuanced reflow logic for things like labels. This fixes some cases where grid would end up either too small or too large for its content.
  • Fix crash in XAML with DataTemplates and event subscription.
  • ListView/TableView respect WidthRequest/HeightRequest again (regression in 1.3.0-pre2)
  • No longer crash when trying to download/access the same UriImageSource on hundreds of images (System.IOException).
  • Fix issue where Grid sometimes measured out taller than it should, especially in ListView/StackLayout. Grid now prefers to expand in the direction of a "defined" constraint, which tends to match expected behavior when measuring. If both constraints are Infinite, previous behavior is retained.
  • BindableObject.SetValue will now properly perform loss-less conversions on base types. e.g. Calling slider.SetValue (Slider.ValueProperty, 6.0f) will now work correctly.
  • Fix issue where StackLayout in a Horizontal orientation would return an incorrect MinimumHeight in GetSizeRequest.
  • Adding a bad Path to a UriImageSource no longer crashes
  • Improved XAML error reporting
  • Fix crash where calling Navigation.PushAsync from re-initialized View sometimes crashed
  • Fix error where cloning a Binding did not clone the Source parameter
  • IsPresented is now respected correctly when using MasterDetailPage. May throw exception now if IsPresented is set to a disallowed value with MasterBehavior.
  • Several bugs relating to culture invariance in XAML parsing.
  • ThicknessConverter no longer depends on device culture
  • Label properly resizes after setting Label.FontSize/Font/FontAttributes Bug
  • XAML InitializeComponent calls in some apps this will result in a massive performance improvement when loading pages.
  • Serialization now property supports DataMemberAttributes
  • ListView and TableView now return consistent sizing across all platforms. This change should not affect most apps, however some apps suffering from inconsistent sizing with ListViews/TableViews should find the situation better.
  • Small set of changes to Layout to enable performance optimization with unneeded measure invalidation.
  • Don't throw NRE in ResourceDictionaries when reparenting
  • Fix map issue with IsShowingUser and location
  • fix binding against arrays (https://bugzilla.xamarin.com/show_bug.cgi?id=24263)
  • Resolve issue where Labels didn't reflow correctly inside of grids
  • RelativeLayout now gives sane error when relative to non-child view
  • fix NRE on removing ListView items (https://bugzilla.xamarin.com/show_bug.cgi?id=23778)
  • x:Reference now works inside other markup extensions.

Android

  • Pressing back and re-entering the app now cleans up the old Activity and associated renderers. This fixes both memory leak issues and some crashes.
  • Label.FontSize = 18 no longer accidentally gives a font size of 14 on any devices.
  • Fix another case where ScrollView content could flow outside of bounds (yay).
  • Fix crash in WebView when being removed from the visual tree.
  • Map no longer re-centers on Layout.
  • MasterDetailPage container width now matches android design guidelines on tablets. (No longer insanely wide).
  • SwitchCell height is no longer squished
  • No longer crashes on Android 5.0
  • No longer renders with a black bar at the bottom of Android 5.0 devices
  • Other compatibility fixes with Android 5.0
  • WebViewRenderer now uses correct path for finding resources
  • Fix issue where calling SetPage multiple times would throw an exception
  • Fix crash when restarting the Activity introduced in last pre-release
  • Fix issue where ListView.SelectedItem = null sometimes did not work as expected.
  • Fix issues where Switch did not show on some Samsung devices
  • Fix issue where rotation ignored the anchor point
  • Fix Button text allignment issue (https://bugzilla.xamarin.com/showbug.cgi?id=21138, https://bugzilla.xamarin.com/showbug.cgi?id=21368)

iOS

  • Renderers are now properly re-used in ListView. Performance enhancement.
  • iOS 8 now uses UIAlertController for alerts.
  • Fix a case where the keyboard could end up overlapping the input area.
  • Mixing swipe to go back and press to go back no longer results in a blank page.
  • ContextAction More/Cancel buttons now translate properly
  • ImageCell no longer flashes old image on cell re-use.
  • Slider now updates bindings correctly due to conversion fix.
  • Button.Image is now rendered with original image to match other platforms
  • Editor now scrolls to the correct location when a keyboard is shown
  • Fix NullReferenceException when assigning to SearchBar.BackgroundColor
  • Fix issue where PushModalAsync could sometimes result in a unhandled exception from UIKit.
  • MasterDetailPage now disposes of child renderers correctly, resolves a memory leak.
  • Fix issue where cells could not be unselected using blank rows.
  • WebViewRenderer now uses correct path for finding resources
  • Resolve issue where calling CreateViewController multiple times would cause an exception
  • Use proxy when downloading images if configured on device.
  • Partial swipes on a NavigationPage no longer cause the NavigationPage to get out of sync with the UINavigationController
  • ActionSheet now correctly shows on iOS 8
  • ActionSheet no longer gets incorrectly positions when rotating while visible.
  • Fix issue on Translating views of zero size
  • Select picker first item (https://bugzilla.xamarin.com/show_bug.cgi?id=22352)
  • TabbedPage now updates icons correctly
  • Fix several memory leaks
  • Modal dialog scrolls to far (https://bugzilla.xamarin.com/show_bug.cgi?id=23904)
  • Fix NRE when disposing some renderers.

WinPhone

  • Fix crash when pressing back button with active ActionSheet.
  • TableView no longer selects wrong item when in Landscape mode.
  • OpenUriAction now uses LaunchUriAsync.
  • Back button now closes ActionSheets and Alerts before attempting Navigation.
  • Picker no longer shows a bunch of blank entries.
  • ListView selection now properly shows up.
  • ListView allows selection of items multiple times in a row if the user calls SelectedItem = null. This behavior matches other platforms correctly now.
  • Label now reports the correct minimum width to match other platforms.
  • Fix crash in Picker

Xamarin Workbook

If it's not already installed, install the Xamarin Workbooks app first. The workbook file should download automatically, but if it doesn't, just click to start the workbook download manually.