passing argments into Tabbed pages from host page

GregKowieskiGregKowieski USUniversity ✭✭

So, I've added up all my classes and trying to put it all together. Surprise! I'm stuck.... I've googled my brains out, but to no avail....

I have a PCL app with Droid using Xam Forms. I get my dbPath from the device specific code and open my main page passing up the dbPath just fine. My main page is a TabbedPage with two children:

public App(string dbPath)
{
VendorRepo = new Repositories.VendorRepository(dbPath);
VendorRepo.InitVendorRepository(dbPath);

        MainPage = new NavigationPage(new  MainPage());
    }

<?xml version="1.0" encoding="utf-8" ?>

<TabbedPage.Children>
<me:Pages.SingleEntryPage></me:Pages.SingleEntryPage>
<me:Pages.MultiEntryPage></me:Pages.MultiEntryPage>
</TabbedPage.Children>

My question is: Since the tabbed pages are opened without code, how can I pass up the dbPath so I can populate my data in the child pages. I get that pages should be autonomous in android, so for one of my pages, it should be able to receive the dbPath and then get its data from the related repository.

Any help for a newbie is appreciated.

Best Answer

Answers

  • GregKowieskiGregKowieski USUniversity ✭✭

    Man! I was so close. I passed the arguments incorrectly. I could see how to do it in code, but am trying to learn xaml to see what doors it opens. Thanks for your help again Rob!

Sign In or Register to comment.