Prathap reddy k
Prathap reddy k

Reputation: 1

Navigating back and forth not working

hi i created an app which contains three pages, if go from MainPage to Page1 and reversely 3 to 4 times it ts working fine, but when i Navigate from Mainpage to Page 2 it is working but when i navigate back from Page 2 to Main Page it is opening MainPage after 1 second it is going back to Page2

can you please tell me the solution for this

Upvotes: 0

Views: 81

Answers (1)

Arrie
Arrie

Reputation: 1337

Okay i am going to give this a wild guess seeing that you have not given code , on each page there is a override method you can use, onNavigatedTo.

what i will do is put an OnNavigatedTo event on each page and put a break point in that event and step to see what each individual page does, here is a quick example where i use onnavigated to test if the navigation to this page was a 'back' navigation!

     protected async override void OnNavigatedTo(NavigationEventArgs e)
        {
            //Check if navigation was back!
            // you can add the breakpoint here if you want to.

            if (e.NavigationMode == NavigationMode.Back)
            {
                messagebox.show("Nav is back!");
            }

now you can easily see what each individual page does when navigated to :) hope this helps a bit.

Upvotes: 1

Related Questions