Properties of BindingContext are not set on Xamarin.Forms project

Hi,

I am trying to set BindingContext of my ContentPage.

As an example I tried Hanselman.Forms project on Github and when I debugged the MenuPage.xaml.cs, BindingContext is successfully set with the following lines :

BindingContext = new BaseViewModel
{
Title= "Hanselman.Forms",
Subtitle="Hanselman.Forms",
Icon = "slideout.png")
};

As seen here:
us.v-cdn.net/5019960/uploads/editor/cc/wg85o6dxqu24.png

In this example BaseViewModel is a class contained in Refactored.MvvmHelpers project on Github.

But when I try the same thing on my project BindingContext properties are not set. As seen here:
us.v-cdn.net/5019960/uploads/editor/4g/f3ijt96n7ioe.png

Also when I look at BindingContext of Hanselman.Forms project via a watch, I can see public properties. As you can see here:
us.v-cdn.net/5019960/uploads/editor/of/jk7zf8a8qwqj.png

But when I try to look at BindingContext in my project with a watch this is what I see
us.v-cdn.net/5019960/uploads/editor/c5/bwfdh54eq92u.png

I don't know what could be causing this strange behaviour.

As extra info:

Both solutions' core projects are .NET Standard Library v2.0.
Both solutions' Xamarin.Forms Nuget packages are the latest version.

Thanks in advance.

Note: I had to strip my image links from https to avoid "You have to be around for a little while longer before you can post links." error. Sorry for bad format.

Answers

Sign In or Register to comment.