Bug 46921

Summary: XAML compiler produces invalid IL for resources using property element syntax, or even attributes
Product: Forms Reporter: Kent <kent.boogaart>
Component: FormsAssignee: Bugzilla <bugzilla>
Status: VERIFIED FIXED    
Severity: normal CC: david, hvaughan3, jas, kent.boogaart, parmendrak, stephane.delcroix
Priority: ---    
Version: 2.3.3   
Target Milestone: ---   
Hardware: PC   
OS: Windows   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Repro solution

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.