Forum Xamarin.Forms
We are excited to announce that the Xamarin Forums are moving to the new Microsoft Q&A experience. Q&A is the home for technical questions and answers at across all products at Microsoft now including Xamarin!

We encourage you to head over to Microsoft Q&A for .NET for posting new questions and get involved today.

Specified cast is not valid

A_VA_V USMember ✭✭✭
edited May 2019 in Xamarin.Forms


I am trying to navigate to the content page from rg.plugins.popup page. So I am trying like

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

but it is showing Specified cast is not valid exception.Please help me for navigating from rg.plugins.popup page to contentpage.


  • burakkurtarirburakkurtarir Member ✭✭

    var masterDetailPage = new YourMasterDetailPageName()
    Detail = new NavigationPage(new YourPageNameToBePush())

            Application.Current.MainPage = masterDetailPage;

    Can you try this ?

  • JarvanJarvan Member, Xamarin Team Xamurai
    edited May 2019

    You should use New NavigationPage(), refer to the code:

    Detail = new NavigationPage(...);
    Detail.Navigation.PushAsync(new page());
Sign In or Register to comment.