I want to setup a tabbed page with three content pages they are page1, page2 and page3 all of them are content pages. When the program starts I want to show page1 content page with page1 tab selected. They do not follow item template model since they are all different content pages compared to the example showing in the Tabbed Page example @ xamarian.
<TabbedPage.Children>
<ContentPage Title="Page 1" />
<ContentPage Title="Page 2" />
<ContentPage Title="Page 3" />
</TabbedPage.Children>
What property I should set here so that I can point to the content of the associated content page or do I follow tab selecte event and manually call the appropriate content page? I would like to try to do it with XAML as much as possible. Thanks
Now, right click on your portable project -> Add -> New item. Then, go to Cross-Platform -> Forms Tabbed Page Xaml (rename it) -> click Add. Now, you will see some code in your tabbed page. A tab page is a parent page that contains multiple pages in it.
We can add the content above or below the tab view component. But it's not possible in xamarin tabbed page.
Xamarin Forms is updated in Android project. For Adding Xaml ContentPage, right click XamFormConPage(Portable) project and select ADD-> NewItem. Select -> CrossPlatform -> FormXamlPage -> Give it a relevant name. Now, XAML Content Page is added to your project.
Go to Solution Explorer-->Your Project-->Portable-->Right click-->Add-->New Item (Ctrl+Shift+A). Now, select Forms XAML page and give the name (MainPage. xaml). In this step, add another one page, whose name is called SecondPage.
Found the answer here just in case looking for the same question. In my case, I was able to do it in the code behind, but you can do the same in XAML as the post says. One additional thing is, when you add a content page to a tab item and if you want to add title and Icon to it, then you can reference the index of the child and you can set them manually as .Tile and .Icon.
this.Children.Add( new Page1 ());
this.Children[0].Title = "Page 1";
this.Children[1].Icon = "page1.png"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With