This is Xamarin's bug tracking system. For product support, please use the support links listed in your Xamarin Account.
Bug 44216 - No property, bindable property, or event found Wen using xamlc
Summary: No property, bindable property, or event found Wen using xamlc
Alias: None
Product: Forms
Classification: Xamarin
Component: Forms (show other bugs)
Version: 2.3.2
Hardware: PC Windows
: Normal normal
Target Milestone: ---
Assignee: Bugzilla
Depends on:
Reported: 2016-09-12 19:07 UTC by nicollas braga
Modified: 2017-02-02 14:35 UTC (History)
3 users (show)

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


Description nicollas braga 2016-09-12 19:07:10 UTC
I've create an Behavior, its compile and run without any problem when using the default xaml

but wen you try to use the xamlc ([assembly: XamlCompilation(XamlCompilationOptions.Compile)]) 

its don't compile with error Position 13:72. No property, bindable property, or event found for 'MinLengh'

<?xml version="1.0" encoding="utf-8" ?>
<ContentPage xmlns=""
      <StackLayout VerticalOptions="CenterAndExpand" Padding="5,0,0,5">
        <Label Text="Cdade" />
        <Entry x:Name="cidade" Placeholder="Cidade - UF" >
            <Controls:RequiredBehavior x:Name="cidadeRequiredBehavior" MinLengh="5"/>

 public class RequiredBehavior : Behavior<Entry>
        static readonly BindablePropertyKey IsValidPropertyKey = BindableProperty.CreateReadOnly("IsValid", typeof(bool), typeof(ComparisonBehavior), false);
        public static readonly BindableProperty IsValidProperty = IsValidPropertyKey.BindableProperty;
        static readonly BindableProperty MinLenghProperty = BindableProperty.Create("MinLengh", typeof(int), typeof(ComparisonBehavior), 1);
        static readonly BindableProperty MaxLenghProperty = BindableProperty.Create("MaxLengh", typeof(int), typeof(ComparisonBehavior), int.MaxValue);

        /// <summary>
        /// Get the value that determine if the value has validated
        /// </summary>
        public bool IsValid
            get { return (bool)base.GetValue(IsValidProperty); }
            private set { base.SetValue(IsValidPropertyKey, value); }

        /// <summary>
        /// Get or Set the min lengh 
        /// </summary>
        public int MinLengh
            get { return (int)base.GetValue(MinLenghProperty); }
            private set { base.SetValue(MinLenghProperty, value > 0 ? value: 1); }

        /// <summary>
        /// Get or Set the max lengh 
        /// </summary>
        public int MaxLengh
            get { return (int)base.GetValue(MaxLenghProperty); }
            private set { base.SetValue(MaxLenghProperty, value > 0 ? value: 1); }
Comment 1 Stephane Delcroix 2017-01-25 13:49:37 UTC
You're not going to like it, but XamlC is right in failing, and the normal parser should fail as well for the following reason:
 - the BindableProperty MinLengh is private,
 - the setter for the MinLengh property is private as well.

Here's the fix that will make it fail all the time
Comment 2 Stephane Delcroix 2017-02-02 14:35:12 UTC
this will be fixed in 2.3.5-pre1

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