Specified cast is not valid

abvabv USMember ✭✭✭
edited May 29 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 29

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

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