Can't open specific page in TabbedPage with Prism Navigation

VinciusdaCruzMaiaVinciusdaCruzMaia BRMember ✭✭
edited May 2018 in Xamarin.Forms

I have a TabbedPage with two tabs in my app and I want use NavigateAsync to navigate to a specif tab, but when I use NavigationService.NavigateAsync ("NavigationPage/TabbedPage/SelectedPage"), my app open only SelectedPage with TabbedPage in the stack. I can click on the back button in SelectedPage to back to the TabbedPage.

Does anyone had any idea about what I'm doing wrong?

Here is my TabbedPage axml:

Here is my OnInitialized method and RegisterTypes in App class:

        protected override async void OnInitialized()
        {
            InitializeComponent();

            if (Device.RuntimePlatform.Equals(Device.Android))
            {
                await NavigationService.NavigateAsync("Android.Main/OdontoWayPacienteNavigation/Sobre");
            }
            else
            {
                await NavigationService.NavigateAsync("/NavigationPage/iOS.Main/Sobre");
            }
        }

        protected override void RegisterTypes(IContainerRegistry containerRegistry)
        {
            containerRegistry.RegisterForNavigation<OdontoWayPacienteNavigation>();
            containerRegistry.RegisterForNavigation<NavigationPage>();
            containerRegistry.RegisterForNavigation<Pacientes>();
            containerRegistry.RegisterForNavigation<Clinicas>();
            containerRegistry.RegisterForNavigation<PacienteEdit>();
            containerRegistry.RegisterForNavigation<ClinicaMap>();
            containerRegistry.RegisterForNavigation<LinkWeb>();
            containerRegistry.RegisterForNavigation<Sobre>();
            containerRegistry.RegisterForNavigation<Views.Android.PacienteAcessos, PacienteAcessosViewModel>("Android.PacienteAcessos");
            containerRegistry.RegisterForNavigation<Views.iOS.PacienteAcessos, PacienteAcessosViewModel>("iOS.PacienteAcessos");
            containerRegistry.RegisterForNavigation<Views.Android.Main, MainViewModel>("Android.Main");
            containerRegistry.RegisterForNavigation<Views.iOS.Main>("iOS.Main");
        }

Best Answer

Answers

Sign In or Register to comment.