Quantcast
Channel: Recent Threads — Xamarin Community Forums
Viewing all articles
Browse latest Browse all 204402

How to use a content page in tabbed page?

$
0
0

First of all, my app has a master-detail page menu and I want to use master-detail struct with tabbed page. Actually I have a menu item which is an entry item and called "Quick Search". When user types a word to this quick search area and clicks its button, menu opens TabbedPage. Normally, menu items open a ContentPage. Here is the problem starts. I want to open 4 different content pages in a tabbed page as a child. These content pages use async method to get data from the server, that is why I cannot navigate among these pages if they added as a child item to the TabbedPage. If a content page not use async method, I can navigate without any problems. You can reach my codes below.

I set my MainPage in App.cs like
MainPage = new NavigationPage(new WelcomePage());

User clicks a button in the WelcomePage and then master-detail page items are set like
public MasterDetailPage masterDetail= new MasterDetailPage();
masterDetail.Master = new Menu();
masterDetail.Detail = new NavigationPage(new HomePage());
Application.Current.MainPage = masterDetail;

If user click quick search button, TabbedPage navigation is provided like
Application.Current.MainPage = new NavigationPage(new QuickSearch());

Children are added to TabbedPage (QuickSearch) like
this.Children.Add(new ContenPage1() { Title = "Item1" });
this.Children.Add(new ContenPage2() { Title = "Item2" });
this.Children.Add(new ContenPage3() { Title = "Item3" });
this.Children.Add(new ContenPage4() { Title = "Item4" });


Viewing all articles
Browse latest Browse all 204402

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>