Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

No property, bindable property, or event found for 'YConstraint' after update to Forms

Hello, I have a annoying problem after the update from Xamarin.Forms 2.3.2 to 2.3.3. I'm not able to build my project anymore. The build stops on usage of the MarkupExtension -> RelativeToViewVertical on XAML Pages with a XML Error: "No property, bindable property, or event found for 'YConstraint'"

Xaml Usage:
.. xmlns:support="clr-namespace:MyApp.Layout;assembly=MyApp" .. <RelativeLayout> <Label FontSize="13" Text="{Binding DetailText}" RelativeLayout.YConstraint="{ConstraintExpression Type=Constant, Constant=50}" RelativeLayout.WidthConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Constant=-142}" RelativeLayout.HeightConstraint="{ConstraintExpression Type=Constant, Constant=60}" /> <Button Text="test" BackgroundColor="Transparent" BorderColor="Transparent" FontSize="14" Command="{Binding ForgotPassword}" RelativeLayout.YConstraint="{support:RelativeToViewVertical ElementName=ElementBefore, Constant=105}" <!-- crashes here --> RelativeLayout.XConstraint="{ConstraintExpression Type=RelativeToParent, Property=Width, Constant=-170}" />

With that kind Extension:

The error appears since Forms 2.3.3-pre1 ( works fine). When I setup a new Project with Forms 2.3.3 and the RelativeToViewVertical code it works. Any ideas?

Best Answer


  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Do you get the error without the Extension ?

  • TimoGalongaTimoGalonga DEMember ✭✭

    If I remove all the "{support:RelativeToView..." usages from the xaml code the app builds and works beside the now appearing layoutproblems.

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Maybe that library needs to be updated ?

  • TimoGalongaTimoGalonga DEMember ✭✭

    hm.. which library do you mean? The RelativeToView logic is just in code .. and the same code works on a new xam.forms 2.3.3 project.

  • rmarinhormarinho PTMember, Insider, Beta Xamurai

    Oh sorry i was thinking RelativeToView was code on other library. Are you sure all projects have the same nuget version ?

    Also just to make sure nuke obj and bin folders to see if is some files that aren't being rebuild.

  • TimoGalongaTimoGalonga DEMember ✭✭
    edited November 2016

    @StephaneDelcroix thanks - that helps. Implementing IMarkupExtension<Constraint> solve my problem :blush:

  • JoeMankeJoeManke USMember ✭✭✭✭✭
    edited February 2017

    I'm having the same problem after updating from to The solution of implementing IMarkupExtension<T> unfortunately doesn't work, because my extension already does so. If I turn off XamlC the code still works.

    Repro project is attached.

    EDIT: Oddly enough, changing my implementation to not be generic seems to work.

  • TimoGalongaTimoGalonga DEMember ✭✭
    edited February 2017

    Implementation looks like that:

    object IMarkupExtension.ProvideValue(IServiceProvider serviceProvider) { return (this as IMarkupExtension<Constraint>)?.ProvideValue(serviceProvider); }

Sign In or Register to comment.