Further to This Question regarding BindingContext
I'm looking at a Xamarin.Forms project that implements MVVM , when I look into a XAML page, for example SomePage.xaml
and I want to find the ViewModel that has the logic for that page, it's usually a hit and a miss.
In simpler Xamarin.Forms applications I would just look into SomePage.xaml.cs
to see the bindingContext.
But it seems in a bigger app this is "Abstracted Somewhere"
For example in SomePage.xaml
I see :
x:Class="MyApp.SomePage"
But this is usually not the class containing the code, it seems to be the code representation of the XAML file
I had more luck when I search for SomePageViewModel.cs
, but not all the time.
Searching for the term bindingContext
in the code yielded no results.
My question is where else can I look for
bindingContext
, to determine what classes contains the code controlling the XAML pages.
It seems that this is abstracted in some way because I see in the code BindableBase
.
BindingContext
set in the .cs or in the .xaml I would search for references of the page because they might be creating the page and setting the context there before pushing the page. – Nick Peppers