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

  • SEARCH
  • Home
  • 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 6955623
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 27, 20262026-05-27T14:45:39+00:00 2026-05-27T14:45:39+00:00

I am building an app for Windows Phone 7.1 using c#. when the app

  • 0

I am building an app for Windows Phone 7.1 using c#.

when the app is opening, if the user is the first time using it, then go to the “set up a password” page, else go to the “login page”.

I wanted to use NavigationService.Navigate(Uri), but I don’t know where should i call this function?

  • 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-05-27T14:45:40+00:00Added an answer on May 27, 2026 at 2:45 pm

    I suggest to save the password to some sort of (encrypted) persistent storage, and try to retrieve it when the app starts.

    Then add this code in the App.xaml and it should do the trick

    void RootFrame_Navigating(object sender, NavigatingCancelEventArgs e)
    {
        // Only care about MainPage 
        if (e.Uri.ToString().Contains("/MainPage.xaml") != true) 
             return;
    
        var password = GetPasswordFromSomePersistentStorage();
    
        // Cancel current navigation and schedule the real navigation for the next tick 
        // (we can't navigate immediately as that will fail; no overlapping navigations 
        // are allowed) 
        e.Cancel = true; 
        RootFrame.Dispatcher.BeginInvoke(delegate 
        { 
            if (string.IsNullOrWhiteSpace(password)) 
                RootFrame.Navigate(new Uri("/InputPassword.xaml", UriKind.Relative)); 
            else 
                RootFrame.Navigate(new Uri("/ApplicationHome.xaml", UriKind.Relative)); 
        });
    }
    

    Make sure you have added the handler on the App() constructor

    RootFrame.Navigating += new NavigatingCancelEventHandler(RootFrame_Navigating);
    

    And also, the MainPage.xaml, is just and empty page (set it up as you begin page) that will be used to catch the initial navigation event.

    Hope its helps.

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

Sidebar

Related Questions

Whilst building a Windows Phone 7 app. using the MVVM pattern we've struggled to
I'm building my first simple Windows Phone app. I'm having some trouble though. I'm
I am building a prototype of a windows phone 7 app using d:DesignData in
Im building an app for Windows phone 7. I have a panorama page with
New to OAuth and RestSharp. I'm building a Windows Phone app, using RestSharp to
I'm building a Windows Phone 7.5 app that needs to play videos that are
I'm building an app using Windows Azure Table. I've encapsulated all my calls to
I am building an app for windows phone sdk 7.0 and 7.1, I want
I am building a WPF app using navigation style pages and not windows. I
I'm currently learning how to develop and building an app for windows phone 7.

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.