Bug 37003 - Compiled XAML - Exception thrown with AbsoluteLayout containing AutoSize child
Summary: Compiled XAML - Exception thrown with AbsoluteLayout containing AutoSize child
Status: RESOLVED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.0.0
Hardware: PC Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2015-12-15 01:32 UTC by Drew Lederman
Modified: 2016-01-04 09:50 UTC (History)
6 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Sample app (30.96 KB, application/zip)
2015-12-15 01:38 UTC, Drew Lederman
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on Developer Community or GitHub with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Drew Lederman 2015-12-15 01:32:58 UTC
When XAML compilation is enabled, an exception is thrown when loading a page that contains an AbsoluteLayout with a child whose LayoutBounds use AutoSize:

Stack Trace:

System.InvalidOperationException: Cannot convert ".5, .5, AutoSize, AutoSize" into Xamarin.Forms.Rectangle
  at Xamarin.Forms.RectangleTypeConverter.ConvertFrom (System.Globalization.CultureInfo culture, System.Object value) [0x000aa] in <filename unknown>:0
  at Sample.MainPage.InitializeComponent () [0x0004b] in <filename unknown>:0
  at Sample.MainPage..ctor () [0x00008] in /Development/Sample/MainPage.xaml.cs:14
  at Sample.App..ctor () [0x00008] in /Development/Sample/Sample.cs:12
  at Sample.iOS.AppDelegate.FinishedLaunching (UIKit.UIApplication app, Foundation.NSDictionary options) [0x00007] in /Development/Sample/iOS/AppDelegate.cs:17
  at at (wrapper managed-to-native) UIKit.UIApplication:UIApplicationMain (int,string[],intptr,intptr)
  at UIKit.UIApplication.Main (System.String[] args, IntPtr principal, IntPtr delegate) [0x00005] in /Users/builder/data/lanes/2506/eb4c1ef1/source/maccore/src/UIKit/UIApplication.cs:77
  at UIKit.UIApplication.Main (System.String[] args, System.String principalClassName, System.String delegateClassName) [0x00038] in /Users/builder/data/lanes/2506/eb4c1ef1/source/maccore/src/UIKit/UIApplication.cs:61
  at Sample.iOS.Application.Main (System.String[] args) [0x00008] in /Development/Sample/iOS/Main.cs:17


Attached is a sample app that demonstrates the issue.
Comment 1 Drew Lederman 2015-12-15 01:38:57 UTC
Created attachment 14293 [details]
Sample app
Comment 2 René 2015-12-21 07:52:11 UTC
To confirm the issue: it happens in my project too.

Forms version: 2.0.0.6490
Comment 3 René 2015-12-21 07:56:51 UTC
Workaround: use -1 instead of AutoSize