Forum Xamarin.Forms

Xamarin.Forms.Xaml.XamlParseException: 'Position 61:50. Can not find the object referenced by ThisPa

LofiMAMLofiMAM Member ✭✭

in latest stable release of xamarin forms there is a problem, when I try to give a cell value that does not exist in its own BindingContext but in the page BindingContext I have to write something like that
<<<AddToFavoritesCommand="{Binding Source={x:Reference ThisPage}, Path=BindingContext.AddToFavoritesCommand}">>>
but is throw an exception
<<<Xamarin.Forms.Xaml.XamlParseException: 'Position 61:50. Can not find the object referenced by ThisPage'>>>
when I turn Xamarin.Forms version to version less than 4.1 is work fine but 4.1 and above is still give me the above exception.
is there any help or workaround?


  • AlessandroCaliaroAlessandroCaliaro ITMember ✭✭✭✭✭
    Post the Xaml
  • NMackayNMackay GBInsider, University admin

    Yikes, don't tell me RelativeSource binding has been broken? a breaking change that big would be in the release notes as it's used by everyone...mostly who uses XAML.

  • SafakktemSafakktem USMember ✭✭

    Same Problem. I upgraded Xamarin.Forms to all reference bindings broken.

  • JThunJThun SEMember ✭✭

    Same here. Downgrade to seems to have fixed it.

  • MatteoComiMatteoComi USMember ✭✭

    I have the same problem with XF version Any news on this?

  • FreakyAliFreakyAli USMember ✭✭

    Well after searching forever I found this Git issue:, which basically says that after some latest changes XamlC started acting up :disappointed: but the good news is there is a workaround, For now, you can just skip that page in your XamlC and it should start working. All you need to is add the below code in your Page's xaml.cs file above class declaration:

     public partial class YourContentPage: ContentPage
Sign In or Register to comment.