Bug 30699 - xaml variable not recognized in code-behind file
Summary: xaml variable not recognized in code-behind file
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms ()
Version: 1.4.4
Hardware: PC Windows
: --- normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2015-06-02 22:52 UTC by Mike
Modified: 2015-06-03 08:45 UTC (History)
5 users (show)

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

variable declared in xaml not recognized in (4.48 MB, application/x-zip-compressed)
2015-06-02 22:52 UTC, Mike

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 Mike 2015-06-02 22:52:02 UTC
Created attachment 11445 [details]
variable declared in xaml not recognized in

Hi, please find attached a little project I created that shows how my variable is not recognized in the code behind file of a form.  I am implementing a custom renderer in Android for a custom control in my PCL.
Comment 1 Stephane Delcroix 2015-06-03 03:29:49 UTC
Xaml is case sensitive. See e.g. https://msdn.microsoft.com/en-us/library/cc189036(VS.95).aspx#xaml_and_xml

> XAML as a language is case-sensitive. This is another consequence of XAML being based on XML,
> which is case-sensitive. The names of XAML elements and attributes are case-sensitive. The value
> of an attribute is potentially case-sensitive; this will depend on how the attribute value is handled
> for particular properties.

so instead of 

    <local:MyCUstomControl x:name="myCustomControl" />

you should write 

    <local:MyCustomControl x:Name="myCustomControl" />
Comment 2 Mike 2015-06-03 07:02:08 UTC
Apologies, but my bug is still valid- I changed the case of the character and this still applies!
Comment 3 Mike 2015-06-03 07:07:19 UTC
Apologies again!  Sorry for that - I didn't realize I was a dingbat twice!  :-)
Comment 4 Stephane Delcroix 2015-06-03 08:45:36 UTC
yes, there was 2 typos in it... great to hear you got that to work.