Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8648147
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T13:14:49+00:00 2026-06-12T13:14:49+00:00

Am using pages in my application and let me explain simply for your understanding.

  • 0

Am using pages in my application and let me explain simply for your understanding.

I have pages A,B and C.
From page A -> page B,
page A -> page C are possible.

I need to do a action only when the page A is resumed from page B and not from page C.

How can i make it possible, can i be able to send some flag data back to page A from page B’s OnBackPressed. And if so where can i listen to get that flag data in page A.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-12T13:14:50+00:00Added an answer on June 12, 2026 at 1:14 pm

    You can use a QueryString. When navigating from B to A, add your QueryString to the URL:

    NavigationService.Navigate(new Uri("/PageA.xaml?PreviousPage=b", UriKind.Relative));
    

    Then, in A's OnNavigatedTomethod, you can check what the value of the PreviousPage QueryString and react accordingly if its value is b.

    protected override void OnNavigatedTo(NavigationEventArgs e)  
    {
         base.OnNavigatedTo(e);
    
         string prevPage="";
    
         NavigationContext.QueryString.TryGetValue("PreviousPage", out prevPage);
    
         if(prevPage == "b")
         {
             //code to call if A is resuming from B
         }    
    }
    

    Update based on comment (will leave the code above for others)

    There are a couple of options regarding the BackKey. Firstly, you can use the code above and then delete that particular page from the history. You can do this by using the RemoveBackEntry method within the code above:

    if(NavigationService.CanGoBack)
       NavigationService.RemoveBackEntry();
    

    You can see more about the Back Stack here.

    Alternatively, you could keep track of a global variable, in App.xaml.cs for example, that is updated whenever a user leaves a page. Then, in A, you can check that variable and see what the previous page was (and reset the variable if need be so that it’s not read again accidentally).

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

in my application i am using master page and child pages. my requirement is
I have developed the android phonegap application using html page and css. But My
Im using a System.Windows.Controls.PrintDialog to let the user print one or more pages from
I have one winform application. I can get HTML of page using webclient call
I'm creating a CustomizableIntroPart for my Eclipse application. I define my pages using XHTML
I am using UIWebView to display web pages in my application. but when hyperlink
I am using Microsoft Silverlight Analytics Framework in my application to track the pages.
I'm using the single page application template in MVC 4. The template created the
I am trying to make a multiple page application using winforms. I decied to
If you make a page-based application (using UIPageViewController) in xcode 4.3.1 and iOS5 you

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.