Bug 48242

Summary: Binding to constants not working any more in Xamarin Forms 2.3.3
Product: Forms Reporter: Kapil Sachdeva <ksachdeva>
Component: FormsAssignee: Bugzilla <bugzilla>
Status: VERIFIED FIXED    
Severity: normal CC: adebunky, jas, parmendrak, sahou, stephane.delcroix
Priority: ---    
Version: 2.3.3   
Target Milestone: ---   
Hardware: Macintosh   
OS: Mac OS   
Tags: Is this bug a regression?: ---
Last known good build:
Attachments: Sample project to show case XAML compilation error

Description Kapil Sachdeva 2016-11-28 20:57:13 UTC
Below XAML fragment does not work any more and is giving a compilation error

<Image Source="{x:Static helpers:MyConstants.InfoIcon}" />

Compilation error is :

No property, bindable property, or event found for 'Source'

I rolled back to previous version (2.3.2) and the error goes away.

Facing the same issue when trying to see the Icon property of ToolbarItem as well.

Regards
Kapil
Comment 1 Stephane Delcroix 2016-11-29 14:28:46 UTC
We're unable to reproduce your issue, could you provide a sample project, or at least show how `InfoIcon` is declared ?
Comment 2 Kapil Sachdeva 2016-11-29 15:33:14 UTC
public static class MyIcons {
   public const String INFO = "ic_info_outline.png";
}

public class MyConstants {
   public static String InfoIcon = MyIcons.INFO;  
}

I have the XAML compilation ON. If I turn it OFF then I do not see the errors at runtime so it is limited to XAML compilation.

Hope this helps

Regards
Kapil
Comment 3 Stephane Delcroix 2016-11-29 20:53:26 UTC
I'm sorry but I wrote a test using your code, and I still can't reproduce the problem. I think I'll need you to provide me with a very short project showcasing your issue.

Thanks
Comment 4 Kapil Sachdeva 2016-11-29 22:41:27 UTC
Created attachment 18710 [details]
Sample project to show case XAML compilation error

Please find attached a very simple project showcasing the XAML compilation error. Error is only when using Xamarin Forms 2.3.3. It works fine if you use the last Xamarin Forms release
Comment 5 Stephane Delcroix 2016-11-30 08:29:29 UTC
I can confirm this issue
Comment 6 Stephane Delcroix 2016-11-30 13:24:26 UTC
see https://github.com/xamarin/Xamarin.Forms/pull/580
Comment 7 Samantha Houts [MSFT] 2016-12-02 00:38:17 UTC
Should be fixed in 2.3.3-SR1. Thank you!
Comment 8 Parmendra Kumar 2016-12-07 13:25:44 UTC
I have checked this issue with Xamarin.Forms 2.3.3.175 and this issue has been fixed.

Hence closing this issue.


Thanks.
Comment 9 Ahmed Alejo 2017-01-13 10:29:58 UTC
I have checked this issue with Xamarin.Forms 2.3.3.180 and this issue has been regressed.

Hence re-opening this issue is necessary.

Thanks.
Comment 10 Parmendra Kumar 2017-01-13 11:41:10 UTC
@Ahmed,

I have checked this issue with 2.3.3.180 and I am not able to reproduce this issue with latest forms version.
Please clean your solution and if you have still getting same issue please provide us application output, sample project and screencast.

Thanks.