I need all the child pages to use the same model as the parent TabbedPage. My Tabbed Page looks like this:
public class PersonPage : TabbedPage
{
public PersonPage(int personId)
{
BindingContext = new PersonViewModel(personId);
How do I set the BindingContext of the child pages now? I've tried setting it like this:
this.Children.Add(new CoreActivityPage() { Title = "Core", Model = this.Model });
However the Bindings I set in the CoreActivityPage don't do anything.
public class CoreActivityPage : ContentPage
{
public CoreActivityPage()
{
var lblName = new Label()
{
Text = "ffff"
};
lblName.SetBinding(Label.TextProperty,"Name");
Content = new StackLayout()
{
Children = {lblName}
};
}
public PersonViewModel Model
{
get { return BindingContext as PersonViewModel; }
set { BindingContext = value; }
}
}