question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Navigate to another page using PushAsync from ListView inside Popup

See original GitHub issue

Hi, rotorgames. I wanna thank you first for this awesome plugin. But I’ve got a problem, tho.

So, my case is, i have ListView element inside my PopupPage, and I want to give the OnClick action of the list item so it can be navigate to another page which have to be one stack above the home page (main/root page of the popup). and when ‘Back’ button hit, the screen will switch back to the home/main page.

In PopupPage.xaml.cs, I implement this code for listItem.ItemSelected:

async void OnItemSelected(object sender, SelectedItemChangedEventArgs e){
      await Navigation.PushAsync(new FilterResultPage());
}

and I got this error when the function fired

System.InvalidOperationException: PushAsync is not supported globally on Android, please use a NavigationPage.

I think it might be has something to do with Navigation and NavigationPage stuff, I’ve tried some trick, But i still stuck.

Can you help me with this? Thank you so much

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (1 by maintainers)

github_iconTop GitHub Comments

15reactions
widiarifkicommented, Aug 14, 2016

Thanks for your answer @rotorgames, I’m a bit overwhelmed because beside using NavigationPage, I also manage the page using MasterDetailPage, but finally it’s all ok by tried this line:

await ((MainPage)App.Current.MainPage).Detail.Navigation.PushAsync(new FilterResultPage(1, 1));

Thank You.

5reactions
mxdcarmocommented, Jul 17, 2017

I have my app running in a MasterDetail page, so in my ViewModel I use @widiarifki line:

        await((MasterDetailPage1)App.Current.MainPage).Detail.Navigation.PushAsync(new ServicoLista());

Thank’s @widiarifki that really helps

Read more comments on GitHub >

github_iconTop Results From Across the Web

Xamarin portable, how to navigate back from selected list ...
I go to Cities, then select item and return back to my MainPage, but not pop up another page in stack. Just back...
Read more >
Xamarin.Forms Modal Pages
This article demonstrates how to navigate to modal pages. ... modal stack, and the new topmost page becomes the active page, as shown...
Read more >
Is it possible to navigate between pages without using ...
Is it possible to navigate between pages without using PushAsync()? ... in a listview and you call the Page like described in the...
Read more >
Screen transition when tapping ListView - Microsoft Q&A
When I tap ListView, another screen is displayed. If you tap continuously, multiple screens will open. Please tell me the solution.
Read more >
Displaying an ItemDetailsPage for a ListView item – Part 3
So I tried to give it a NavigationPage… await this.Navigation.PushAsync(new NavigationPage(new ItemDetailsPage(tappedFabric))). and I got the ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found