This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 46921 - XAML compiler produces invalid IL for resources using property element syntax, or even attributes
Summary: XAML compiler produces invalid IL for resources using property element syntax...
Status: VERIFIED FIXED
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.3
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
URL:
: 42385 (view as bug list)
Depends on:
Blocks:
 
Reported: 2016-11-14 02:46 UTC by Kent
Modified: 2017-02-07 16:15 UTC (History)
6 users (show)

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


Attachments
Repro solution (186.80 KB, application/x-zip-compressed)
2016-11-14 02:46 UTC, Kent
Details

Description Kent 2016-11-14 02:46:48 UTC
Created attachment 18449 [details]
Repro solution

See attached sample. Also tried in latest stable (2.3.2.127) with same result.

The App.xaml file includes the same resource defined four different ways:

    <Thickness x:Key="SomeThickness">4,20,4,20</Thickness>

    <Thickness
        x:Key="SomeThickness"
        Left="4"
        Top="20"
        Bottom="20"
        Right="4"/>

    <Thickness x:Key="SomeThickness">
        <Thickness.Left>
            4
        </Thickness.Left>
        <Thickness.Top>
            20
        </Thickness.Top>
        <Thickness.Bottom>
            20
        </Thickness.Bottom>
        <Thickness.Right>
            4
        </Thickness.Right>
    </Thickness>

    <Thickness x:Key="SomeThickness">
        <Thickness.Left>
            <x:Double>4</x:Double>
        </Thickness.Left>
        <Thickness.Top>
            <x:Double>20</x:Double>
        </Thickness.Top>
        <Thickness.Bottom>
            <x:Double>20</x:Double>
        </Thickness.Bottom>
        <Thickness.Right>
            <x:Double>4</x:Double>
        </Thickness.Right>
    </Thickness>

Only the first way works - the others result in invalid IL. Disabling compilation for only the App.xaml file results in the desired behavior, but obviously to the detriment of runtime performance.
Comment 1 Stephane Delcroix 2016-11-29 20:59:34 UTC
Thanks for this report. I'll work on that as soon as possible
Comment 2 Stephane Delcroix 2016-12-03 13:27:40 UTC
https://github.com/xamarin/Xamarin.Forms/pull/596
Comment 3 Stephane Delcroix 2016-12-20 16:42:33 UTC
this has been fixed, and will be part of 2.3.4-pre2
Comment 4 Stephane Delcroix 2017-01-18 09:33:53 UTC
*** Bug 42385 has been marked as a duplicate of this bug. ***
Comment 5 Parmendra Kumar 2017-02-07 16:15:57 UTC
I have checked this issue with Xamarin.Forms 2.3.4.192-pre2 and observed that this issue has been fixed.

Hence marked this issue as Verified Fixed.

Note You need to log in before you can comment on or make changes to this bug.