Bug 48242 - Binding to constants not working any more in Xamarin Forms 2.3.3
Summary: Binding to constants not working any more in Xamarin Forms 2.3.3
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 2.3.3
Hardware: Macintosh Mac OS
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-11-28 20:57 UTC by Kapil Sachdeva
Modified: 2017-01-13 11:41 UTC (History)
5 users (show)

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

Sample project to show case XAML compilation error (55.85 KB, application/zip)
2016-11-29 22:41 UTC, Kapil Sachdeva

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:

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.

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

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.

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 and this issue has been fixed.

Hence closing this issue.

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

Hence re-opening this issue is necessary.

Comment 10 Parmendra Kumar 2017-01-13 11:41:10 UTC

I have checked this issue with 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.